github.com/go-graphite/carbonapi@v0.17.0/COMPATIBILITY.md (about) 1 # CarbonAPI compatibility with Graphite 2 3 Topics: 4 * [Default settings](#default-settings) 5 * [URI Parameters](#uri-params) 6 * [Graphite-web 1.1.7 Compatibility](#graphite-web-117-compatibility) 7 * [Supported Functions](#supported-functions) 8 * [Features of configuration functions](#functions-features) 9 10 <a name="default-settings"></a> 11 ## Default Settings 12 13 ### Default Line Colors 14 Default colors for png or svg rendering intentionally specified like it is in graphite-web 1.1.7 15 16 You can redefine that in config to be more more precise. In default config example they are defined in the same way as in [original graphite PR to make them right](https://github.com/graphite-project/graphite-web/pull/2239) 17 18 Reason behind that change is that on dark background it's much nicer to read old colors than new one 19 20 <a name="uri-params"></a> 21 ## URI Parameters 22 23 ### /render/?... 24 25 * `target` : graphite series, seriesList or function (likely containing series or seriesList) 26 * `from`, `until` : time specifiers. Eg. "1d", "10min", "04:37_20150822", "now", "today", ... (**NOTE** does not handle timezones the same as graphite) 27 * `format` : support graphite values of { json, raw, pickle, csv, png, svg } adds { protobuf } and does not support { pdf } 28 * `jsonp` : (...) 29 * `noCache` : prevent query-response caching (which is 60s if enabled) 30 * `cacheTimeout` : override default result cache (60s) 31 * `rawdata` -or- `rawData` : true for `format=raw` 32 33 **Explicitly NOT supported** 34 * `_salt` 35 * `_ts` 36 * `_t` 37 38 _When `format=png`_ (default if not specified) 39 * `width`, `height` : number of pixels (default: width=330 , height=250) 40 * `pixelRatio` : (1.0) 41 * `margin` : (10) 42 * `logBase` : Y-scale should use. Recognizes "e" or a floating point ( >= 1 ) 43 * `fgcolor` : foreground color 44 * `bgcolor` : background color 45 * `majorLine` : major line color 46 * `minorLine` : minor line color 47 * `fontName` : ("Sans") 48 * `fontSize` : (10.0) 49 * `fontBold` : (false) 50 * `fontItalic` : (false) 51 * `graphOnly` : (false) 52 * `hideLegend` : (false) (**NOTE** if not defined and >10 result metrics this becomes true) 53 * `hideGrid` : (false) 54 * `hideAxes` : (false) 55 * `hideYAxis` : (false) 56 * `hideXAxis` : (false) 57 * `yAxisSide` : ("left") 58 * `connectedLimit` : number of missing points to bridge when `linemode` is not one of { "slope", "staircase" } likely "connected" (4294967296) 59 * `lineMode` : ("slope") 60 * `areaMode` : ("none") also recognizes { "first", "all", "stacked" } 61 * `areaAlpha` : ( <not defined> ) float value for area alpha 62 * `pieMode` : ("average") also recognizes { "maximum", "minimum" } (**NOTE** pie graph support is explicitly unplanned) 63 * `lineWidth` : (1.2) float value for line width 64 * `dashed` : (false) dashed lines 65 * `rightWidth` : (1.2) ... 66 * `rightDashed` : (false) 67 * `rightColor` : ... 68 * `leftWidth` : (1.2) 69 * `leftDashed` : (false) 70 * `leftColor` : ... 71 * `title` : ("") graph title 72 * `vtitle` : ("") ... 73 * `vtitleRight` : ("") ... 74 * `colorList` : ("blue,green,red,purple,yellow,aqua,grey,magenta,pink,gold,rose") 75 * `majorGridLineColor` : ("rose") 76 * `minorGridLineColor` : ("grey") 77 * `uniqueLegend` : (false) 78 * `drawNullAsZero` : (false) (**NOTE** affects display only - does not translate missing values to zero in functions. For that use ...) 79 * `drawAsInfinite` : (false) ... 80 * `yMin` : <undefined> 81 * `yMax` : <undefined> 82 * `yStep` : <undefined> 83 * `xMin` : <undefined> 84 * `xMax` : <undefined> 85 * `xStep` : <undefined> 86 * `xFormat` : ("") ... 87 * `minorY` : (1) ... 88 * `yMinLeft` : <undefined> 89 * `yMinRight` : <undefined> 90 * `yMaxLeft` : <undefined> 91 * `yMaxRight` : <undefined> 92 * `yStepL` : <undefined> 93 * `ySTepR` : <undefined> 94 * `yLimitLeft` : <undefined> 95 * `yLimitRight` : <undefined> 96 * `yUnitSystem` : ("si") also recognizes { "binary" } 97 * `yDivisors` : (4,5,6) ... 98 99 ### /metrics/find/? 100 101 * `format` : ("treejson") also recognizes { "json" (same as "treejson"), "completer", "raw" } 102 * `jsonp` : ... 103 * `query` : the metric or glob-pattern to find 104 105 106 107 108 ## Graphite-web 1.1.7 compatibility 109 ### Unsupported functions 110 | Function | 111 |:---------| 112 | events | 113 114 ### Partly supported functions 115 | Function | Incompatibilities | 116 |:----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 117 | asPercent | total: type mismatch: got seriesList, should be any | 118 | averageAbove | n: type mismatch: got integer, should be float | 119 | averageBelow | n: type mismatch: got integer, should be float | 120 | currentAbove | n: type mismatch: got integer, should be float | 121 | currentBelow | n: type mismatch: got integer, should be float | 122 | groupByNode | callback: different amount of parameters, `[averageSeries averageSeriesWithWildcards countSeries current diffSeries maxSeries minSeries multiplySeries multiplySeriesWithWildcards powSeries rangeOf rangeOfSeries stddevSeries sumSeries sumSeriesWithWildcards]` are missing | 123 | groupByNode | callback: type mismatch: got aggFunc, should be aggOrSeriesFunc | | 124 | groupByNodes | callback: different amount of parameters, `[averageSeries averageSeriesWithWildcards countSeries current diffSeries maxSeries minSeries multiplySeries multiplySeriesWithWildcards powSeries rangeOf rangeOfSeries stddevSeries sumSeries sumSeriesWithWildcards]` are missing | 125 | groupByNodes | callback: type mismatch: got aggFunc, should be aggOrSeriesFunc | | 126 | groupByTags | callback: different amount of parameters, `[averageSeries averageSeriesWithWildcards countSeries current diffSeries maxSeries minSeries multiplySeries multiplySeriesWithWildcards powSeries rangeOf rangeOfSeries stddevSeries sumSeries sumSeriesWithWildcards]` are missing | 127 | groupByTags | callback: type mismatch: got aggFunc, should be aggOrSeriesFunc | | 128 | highest | func: type mismatch: got string, should be aggFunc | 129 | integralByInterval | parameter not supported: intervalUnit | 130 | interpolate | limit: type mismatch: got float, should be intOrInf | 131 | interpolate | limit: default value mismatch: got (empty), should be "Infinity" | | 132 | keepLastValue | limit: type mismatch: got integer, should be intOrInf | 133 | keepLastValue | limit: default value mismatch: got "INF", should be "Infinity" | | 134 | legendValue | valuesTypes: different amount of parameters, `[averageSeries avgSeries avg_zeroSeries binary countSeries current currentSeries diffSeries lastSeries maxSeries medianSeries minSeries multiplySeries rangeOf rangeOfSeries rangeSeries si stddevSeries sumSeries totalSeries]` are missing | 135 | lowest | func: type mismatch: got string, should be aggFunc | 136 | maximumAbove | n: type mismatch: got integer, should be float | 137 | maximumBelow | n: type mismatch: got integer, should be float | 138 | minimumAbove | n: type mismatch: got integer, should be float | 139 | minimumBelow | n: type mismatch: got integer, should be float | 140 | nPercentile | n: type mismatch: got integer, should be float | 141 | percentileOfSeries | n: type mismatch: got integer, should be float | 142 | removeAbovePercentile | n: type mismatch: got integer, should be float | 143 | removeAboveValue | n: type mismatch: got integer, should be float | 144 | removeBelowPercentile | n: type mismatch: got integer, should be float | 145 | removeBelowValue | n: type mismatch: got integer, should be float | 146 | round | precision: default value mismatch: got (empty), should be 0 | 147 | scaleToSeconds | seconds: type mismatch: got integer, should be float | 148 | smartSummarize | func: different amount of parameters, `[current rangeOf]` are missing | 149 | smartSummarize | -alignTo: different amount of parameters, `[<nil> days hours minutes months seconds weeks years]` are missing | 150 | smartSummarize | -alignTo: type mismatch: got interval, should be string | 151 | sortBy | func: different amount of parameters, `[average avg avg_zero count current diff last max median min multiply range rangeOf stddev sum total]` are missing | 152 | sortBy | func: default value mismatch: got (empty), should be "average" | 153 | sortBy | reverse: default value mismatch: got (empty), should be false | 154 | timeShift | parameter not supported: alignDst | | 155 | timeSlice | endSliceAt: type mismatch: got interval, should be date | | 156 157 ## Supported functions 158 ## Supported functions 159 | Function | Carbonapi-only | 160 |:--------------------------------------------------------------------------------------------------------|:---------------| 161 | absolute(seriesList) | no | 162 | add(seriesList, constant) | no | 163 | aggregate(seriesList, func, xFilesFactor=None) | no | 164 | aggregateLine(seriesList, func='average', keepStep=False) | no | 165 | aggregateWithWildcards(seriesList, func, *positions) | no | 166 | alias(seriesList, newName) | no | 167 | aliasByMetric(seriesList) | no | 168 | aliasByNode(seriesList, *nodes) | no | 169 | aliasByTags(seriesList, *tags) | no | 170 | aliasSub(seriesList, search, replace) | no | 171 | alpha(seriesList, alpha) | no | 172 | applyByNode(seriesList, nodeNum, templateFunction, newName=None) | no | 173 | areaBetween(seriesList) | no | 174 | asPercent(seriesList, total=None, *nodes) | no | 175 | averageAbove(seriesList, n) | no | 176 | averageBelow(seriesList, n) | no | 177 | averageOutsidePercentile(seriesList, n) | no | 178 | averageSeries(*seriesLists) | no | 179 | averageSeriesWithWildcards(seriesList, *position) | no | 180 | avg(*seriesLists) | no | 181 | cactiStyle(seriesList, system=None, units=None) | no | 182 | changed(seriesList) | no | 183 | color(seriesList, theColor) | no | 184 | compressPeriodicGaps(seriesList) | no | 185 | consolidateBy(seriesList, consolidationFunc) | no | 186 | constantLine(value) | no | 187 | countSeries(*seriesLists) | no | 188 | cumulative(seriesList) | no | 189 | currentAbove(seriesList, n) | no | 190 | currentBelow(seriesList, n) | no | 191 | dashed(seriesList, dashLength=5) | no | 192 | delay(seriesList, steps) | no | 193 | derivative(seriesList) | no | 194 | diffSeries(*seriesLists) | no | 195 | diffSeriesLists(firstSeriesList, secondSeriesList) | no | 196 | divideSeries(dividendSeriesList, divisorSeries) | no | 197 | divideSeriesLists(dividendSeriesList, divisorSeriesList) | no | 198 | drawAsInfinite(seriesList) | no | 199 | exclude(seriesList, pattern) | no | 200 | exp(seriesList) | no | 201 | exponentialMovingAverage(seriesList, windowSize) | no | 202 | fallbackSeries(seriesList, fallback) | no | 203 | filterSeries(seriesList, func, operator, threshold) | no | 204 | grep(seriesList, pattern) | no | 205 | group(*seriesLists) | no | 206 | groupByNode(seriesList, nodeNum, callback='average') | no | 207 | groupByNodes(seriesList, callback, *nodes) | no | 208 | groupByTags(seriesList, callback, *tags) | no | 209 | highest(seriesList, n=1, func='average') | no | 210 | highestAverage(seriesList, n) | no | 211 | highestCurrent(seriesList, n) | no | 212 | highestMax(seriesList, n) | no | 213 | hitcount(seriesList, intervalString, alignToInterval=False) | no | 214 | holtWintersAberration(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d') | no | 215 | holtWintersConfidenceBands(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d') | no | 216 | holtWintersConfidenceArea(seriesList, delta=3, bootstrapInterval='7d', seasonality='1d') | no | 217 | holtWintersForecast(seriesList, bootstrapInterval='7d', seasonality='1d') | no | 218 | logit(seriesList) | no | 219 | identity(name) | no | 220 | integral(seriesList) | no | 221 | integralByInterval(seriesList, intervalString) | no | 222 | interpolate(seriesList, limit) | no | 223 | invert(seriesList) | no | 224 | isNonNull(seriesList) | no | 225 | keepLastValue(seriesList, limit=inf) | no | 226 | legendValue(seriesList, *valueTypes) | no | 227 | limit(seriesList, n) | no | 228 | lineWidth(seriesList, width) | no | 229 | linearRegression(seriesList, startSourceAt=None, endSourceAt=None) | no | 230 | log(seriesList, base=10) | no | 231 | lower(seriesList, *pos) | no | 232 | lowest(seriesList, n=1, func='average') | no | 233 | lowestAverage(seriesList, n) | no | 234 | lowestCurrent(seriesList, n) | no | 235 | map(seriesList, *mapNodes) | no | 236 | mapSeries(seriesList, *mapNodes) | no | 237 | maxSeries(*seriesLists) | no | 238 | maximumAbove(seriesList, n) | no | 239 | maximumBelow(seriesList, n) | no | 240 | minSeries(*seriesLists) | no | 241 | minimumAbove(seriesList, n) | no | 242 | minimumBelow(seriesList, n) | no | 243 | minMax(seriesList) | no | 244 | mostDeviant(seriesList, n) | no | 245 | movingAverage(seriesList, windowSize, xFilesFactor=None) | no | 246 | movingMax(seriesList, windowSize, xFilesFactor=None) | no | 247 | movingMedian(seriesList, windowSize, xFilesFactor=None) | no | 248 | movingMin(seriesList, windowSize, xFilesFactor=None) | no | 249 | movingSum(seriesList, windowSize, xFilesFactor=None) | no | 250 | movingWindow(seriesList, windowSize, func='average', xFilesFactor=None) | no | 251 | multiplySeries(*seriesLists) | no | 252 | multiplySeriesLists(sourceSeriesList, factorSeriesList) | no | 253 | multiplySeriesWithWildcards(seriesList, *position) | no | 254 | nPercentile(seriesList, n) | no | 255 | nonNegativeDerivative(seriesList, maxValue=None) | no | 256 | offset(seriesList, factor) | no | 257 | offsetToZero(seriesList) | no | 258 | pct(seriesList, total=None, *nodes) | no | # Alias for asPercent 259 | perSecond(seriesList, maxValue=None) | no | 260 | percentileOfSeries(seriesList, n, interpolate=False) | no | 261 | pow(seriesList, factor) | no | 262 | powSeries(*seriesLists) | no | 263 | randomWalk(name, step=60) | no | 264 | randomWalkFunction(name, step=60) | no | 265 | rangeOfSeries(*seriesLists) | no | 266 | reduce(seriesLists, reduceFunction, reduceNode, *reduceMatchers) | no | 267 | reduceSeries(seriesLists, reduceFunction, reduceNode, *reduceMatchers) | no | 268 | removeAbovePercentile(seriesList, n) | no | 269 | removeAboveValue(seriesList, n) | no | 270 | removeBelowPercentile(seriesList, n) | no | 271 | removeBelowValue(seriesList, n) | no | 272 | removeBelowValue(seriesList, n) | no | 273 | removeEmptySeries(seriesList, xFilesFactor=None) | no | 274 | round(seriesList, precision) | no | 275 | scale(seriesList, factor) | no | 276 | scaleToSeconds(seriesList, seconds) | no | 277 | secondYAxis(seriesList) | no | 278 | seriesByTag(*tagExpressions) | no | 279 | setXFilesFactor(seriesList, xFilesFactor) | no | 280 | sigmoid(seriesList) | no | 281 | sin(seriesList, amplitude=1, step=60) | no | # Alias for sinFunction 282 | sinFunction(seriesList, amplitude=1, step=60) | no | 283 | smartSummarize(seriesList, intervalString, func='sum', alignTo=None) | no | 284 | sortBy(seriesList, func='average', reverse=False) | no | 285 | sortByMaxima(seriesList) | no | 286 | sortByMinima(seriesList) | no | 287 | sortByName(seriesList, natural=False, reverse=False) | no | 288 | sortByTotal(seriesList) | no | 289 | squareRoot(seriesList) | no | 290 | stacked(seriesLists, stackName='__DEFAULT__') | no | 291 | stddevSeries(*seriesLists) | no | 292 | stdev(seriesList, points, windowTolerance=0.1) | no | 293 | substr(seriesList, start=0, stop=0) | no | 294 | sum(*seriesLists) | no | 295 | sumSeries(*seriesLists) | no | 296 | sumSeriesLists(seriesListFirstPos, seriesListSecondPos) | no | 297 | sumSeriesWithWildcards(seriesList, *position) | no | 298 | summarize(seriesList, intervalString, func='sum', alignToFrom=False) | no | 299 | threshold(value, label=None, color=None) | no | 300 | time(name, step=60) | no | 301 | timeFunction(name, step=60) | no | 302 | timeShift(seriesList, timeShift, resetEnd=True, alignDST=False) | no | 303 | timeSlice(seriesList, startSliceAt, endSliceAt='now') | no | 304 | timeStack(seriesList, timeShiftUnit='1d', timeShiftStart=0, timeShiftEnd=7) | no | 305 | toLowerCase(seriesList, *pos) | no | 306 | toUpperCase(seriesList, *pos) | no | 307 | transformNull(seriesList, default=0, referenceSeries=None) | no | 308 | unique(*seriesLists) | no | 309 | upper(seriesList, *pos) | no | 310 | useSeriesAbove(seriesList, value, search, replace) | no | 311 | weightedAverage(seriesListAvg, seriesListWeight, *nodes) | no | 312 | verticalLine(ts, label=None, color=None) | no | 313 | aliasByBase64(seriesList) | yes | 314 | aliasByPostgres(seriesList, *nodes) | yes | 315 | aliasByRedis(seriesList. keyName) | yes | 316 | baseline(seriesList, timeShiftUnit, timeShiftStart, timeShiftEnd, [maxAbsentPercent, minAvg]) | yes | 317 | baselineAberration(seriesList, timeShiftUnit, timeShiftStart, timeShiftEnd, [maxAbsentPercent, minAvg]) | yes | 318 | count(*seriesLists) | yes | 319 | diff(*seriesLists) | yes | 320 | exponentialWeightedMovingAverage(seriesList, alpha) | yes | 321 | exponentialWeightedMovingAverage(seriesList, alpha) | yes | 322 | fft(seriesList, mode) | yes | 323 | heatMap(seriesList) | yes | 324 | highestMin(seriesList, n) | yes | 325 | ifft(seriesList, phaseSeriesList) | yes | 326 | integralWithReset(seriesList, resettingSeries) | yes | 327 | isNotNull(seriesList) | yes | 328 | kolmogorovSmirnovTest2(seriesList, seriesList, windowSize) | yes | 329 | ksTest2(seriesList, seriesList, windowSize) | yes | 330 | log(seriesList, base=10) | yes | 331 | lowPass(seriesList, cutPercent) | yes | 332 | lowestMax(seriesList, n) | yes | 333 | lowestMin(seriesList, n) | yes | 334 | lpf(seriesList, cutPercent) | yes | 335 | multiply(*seriesLists) | yes | 336 | pearson(seriesList, seriesList, windowSize) | yes | 337 | pearsonClosest(seriesList, seriesList, n, direction) | yes | 338 | polyfit(seriesList, degree=1, offset="0d") | yes | 339 | powSeriesLists(sourceSeriesList, factorSeriesList) | yes | 340 | removeZeroSeries(seriesList, xFilesFactor=None) | yes | 341 | scale(seriesList, factor) | yes | 342 | slo(seriesList, interval, method, value) | yes | 343 | sloErrorBudget(seriesList, interval, method, value, objective) | yes | 344 | stddev(*seriesLists) | yes | 345 | timeShiftByMetric(seriesList, markSource, versionRankIndex) | yes | 346 | tukeyAbove(seriesList, basis, n, interval=0) | yes | 347 | tukeyBelow(seriesList, basis, n, interval=0) | yes | 348 <a name="functions-features"></a> 349 ## Features of configuration functions 350 ### aliasByPostgres 351 1. Make config for function with pairs key-string - request 352 ```yaml 353 enabled: true 354 database: 355 "databaseAlias": 356 urlDB: "localhost:5432" 357 username: "portgres_user" 358 password: "postgres_password" 359 nameDB: "database_name" 360 keyString: 361 "resolve_switch_name_byId": 362 varName: "var" 363 queryString: "SELECT field_with_switch_name FROM some_table_with_switch_names_id_and_other WHERE field_with_switchID like 'var0';" 364 matchString: ".*" 365 "resolve_interface_description_from_table": 366 varName: "var" 367 queryString: "SELECT interface_desc FROM some_table_with_switch_data WHERE field_with_hostname like 'var0' AND field_with_interface_id like 'var1';" 368 matchString: ".*" 369 ``` 370 371 #### Examples 372 373 We have data series: 374 ``` 375 switches.switchId.CPU1Min 376 ``` 377 We need to get CPU load resolved by switchname, aliasByPostgres( switches.*.CPU1Min, databaseAlias, resolve_switch_name_byId, 1 ) will return series like this: 378 ``` 379 switchnameA 380 switchnameB 381 switchnameC 382 switchnameD 383 ``` 384 We have data series: 385 ``` 386 switches.hostname.interfaceID.scope_of_interface_metrics 387 ``` 388 We want to see interfaces stats sticked to their descriptions, aliasByPostgres(switches.hostname.*.ifOctets.rx, databaseAlias, resolve_interface_description_from_table, 1, 2 ) 389 will return series: 390 ``` 391 InterfaceADesc 392 InterfaceBDesc 393 InterfaceCDesc 394 InterfaceDDesc 395 ``` 396 397 2. Add to main config path to configuration file 398 ```yaml 399 functionsConfigs: 400 aliasByPostgres: /path/to/funcConfig.yaml 401 ``` 402 -----