Created
December 17, 2023 15:53
-
-
Save Marthym/8f83e310b4f4085afd7c9e7c98d8e9c1 to your computer and use it in GitHub Desktop.
Otela
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "__inputs": [ | |
| { | |
| "name": "DS_PROMETHEUS", | |
| "label": "Prometheus", | |
| "description": "", | |
| "type": "datasource", | |
| "pluginId": "prometheus", | |
| "pluginName": "Prometheus" | |
| } | |
| ], | |
| "__elements": {}, | |
| "__requires": [ | |
| { | |
| "type": "panel", | |
| "id": "bargauge", | |
| "name": "Bar gauge", | |
| "version": "" | |
| }, | |
| { | |
| "type": "panel", | |
| "id": "geomap", | |
| "name": "Geomap", | |
| "version": "" | |
| }, | |
| { | |
| "type": "grafana", | |
| "id": "grafana", | |
| "name": "Grafana", | |
| "version": "10.0.3" | |
| }, | |
| { | |
| "type": "datasource", | |
| "id": "prometheus", | |
| "name": "Prometheus", | |
| "version": "1.0.0" | |
| }, | |
| { | |
| "type": "panel", | |
| "id": "stat", | |
| "name": "Stat", | |
| "version": "" | |
| }, | |
| { | |
| "type": "panel", | |
| "id": "timeseries", | |
| "name": "Time series", | |
| "version": "" | |
| } | |
| ], | |
| "annotations": { | |
| "list": [ | |
| { | |
| "builtIn": 1, | |
| "datasource": { | |
| "type": "grafana", | |
| "uid": "-- Grafana --" | |
| }, | |
| "enable": true, | |
| "hide": true, | |
| "iconColor": "rgba(0, 211, 255, 1)", | |
| "name": "Annotations & Alerts", | |
| "type": "dashboard" | |
| } | |
| ] | |
| }, | |
| "editable": true, | |
| "fiscalYearStartMonth": 0, | |
| "graphTooltip": 0, | |
| "id": null, | |
| "links": [], | |
| "liveNow": false, | |
| "panels": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "links": [], | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "blue", | |
| "value": 80 | |
| }, | |
| { | |
| "color": "purple", | |
| "value": 100 | |
| } | |
| ] | |
| }, | |
| "unit": "none" | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 8, | |
| "w": 12, | |
| "x": 0, | |
| "y": 0 | |
| }, | |
| "id": 2, | |
| "options": { | |
| "displayMode": "gradient", | |
| "minVizHeight": 10, | |
| "minVizWidth": 0, | |
| "orientation": "horizontal", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showUnfilled": true, | |
| "valueMode": "color" | |
| }, | |
| "pluginVersion": "10.0.3", | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "exemplar": false, | |
| "expr": "sort_desc(\n sum by (span_name) (otela_calls_total{service_name=\"$site\"}) \n - \n sum by (span_name) (otela_calls_total{service_name=\"$site\"} offset $__range \n or otela_calls_total{service_name=\"$site\"} * 0)!= 0)", | |
| "hide": false, | |
| "instant": true, | |
| "legendFormat": "{{path}}", | |
| "range": false, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Par Page", | |
| "type": "bargauge" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "description": "", | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "blue", | |
| "value": 100 | |
| }, | |
| { | |
| "color": "purple", | |
| "value": 200 | |
| } | |
| ] | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 4, | |
| "w": 2, | |
| "x": 12, | |
| "y": 0 | |
| }, | |
| "id": 5, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "auto", | |
| "orientation": "auto", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "textMode": "auto" | |
| }, | |
| "pluginVersion": "10.0.3", | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "exemplar": false, | |
| "expr": "(count(count by (ip) (otela_calls_total{service_name=\"$site\"})))\n- count(count by (ip) (otela_calls_total{service_name=\"$site\"} offset $__range))", | |
| "instant": false, | |
| "range": true, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Visiteurs", | |
| "type": "stat" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "custom": { | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| } | |
| }, | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 8, | |
| "w": 10, | |
| "x": 14, | |
| "y": 0 | |
| }, | |
| "id": 6, | |
| "options": { | |
| "basemap": { | |
| "config": {}, | |
| "name": "Layer 0", | |
| "type": "default" | |
| }, | |
| "controls": { | |
| "mouseWheelZoom": true, | |
| "showAttribution": true, | |
| "showDebug": false, | |
| "showMeasure": false, | |
| "showScale": false, | |
| "showZoom": true | |
| }, | |
| "layers": [ | |
| { | |
| "config": { | |
| "showLegend": false, | |
| "style": { | |
| "color": { | |
| "fixed": "dark-green" | |
| }, | |
| "opacity": 0.3, | |
| "rotation": { | |
| "fixed": 0, | |
| "max": 360, | |
| "min": -360, | |
| "mode": "mod" | |
| }, | |
| "size": { | |
| "fixed": 6, | |
| "max": 20, | |
| "min": 5 | |
| }, | |
| "symbol": { | |
| "fixed": "img/icons/marker/circle.svg", | |
| "mode": "fixed" | |
| }, | |
| "textConfig": { | |
| "fontSize": 12, | |
| "offsetX": 0, | |
| "offsetY": 0, | |
| "textAlign": "center", | |
| "textBaseline": "middle" | |
| } | |
| } | |
| }, | |
| "filterData": { | |
| "id": "byRefId", | |
| "options": "A" | |
| }, | |
| "name": "Visitors", | |
| "tooltip": true, | |
| "type": "markers" | |
| } | |
| ], | |
| "tooltip": { | |
| "mode": "details" | |
| }, | |
| "view": { | |
| "allLayers": true, | |
| "id": "coords", | |
| "lat": 20, | |
| "lon": 0, | |
| "padding": 4, | |
| "zoom": 1.7 | |
| } | |
| }, | |
| "pluginVersion": "10.0.3", | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "exemplar": false, | |
| "expr": "sum by (latitude, longitude) (otela_calls_total{service_name=\"$site\"})", | |
| "format": "table", | |
| "instant": true, | |
| "legendFormat": "__auto", | |
| "range": false, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Visitors Origin", | |
| "type": "geomap" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "blue", | |
| "value": 100 | |
| }, | |
| { | |
| "color": "purple", | |
| "value": 200 | |
| } | |
| ] | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 4, | |
| "w": 2, | |
| "x": 12, | |
| "y": 4 | |
| }, | |
| "id": 4, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "auto", | |
| "orientation": "auto", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "textMode": "auto" | |
| }, | |
| "pluginVersion": "10.0.3", | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "expr": "(sum(otela_calls_total{service_name=\"$site\"}))\n- (sum(otela_calls_total{service_name=\"$site\"} offset $__range))", | |
| "instant": false, | |
| "range": true, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Total Visites", | |
| "type": "stat" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "axisCenteredZero": false, | |
| "axisColorMode": "text", | |
| "axisLabel": "", | |
| "axisPlacement": "auto", | |
| "barAlignment": 0, | |
| "drawStyle": "line", | |
| "fillOpacity": 0, | |
| "gradientMode": "none", | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| }, | |
| "lineInterpolation": "linear", | |
| "lineWidth": 1, | |
| "pointSize": 5, | |
| "scaleDistribution": { | |
| "type": "linear" | |
| }, | |
| "showPoints": "auto", | |
| "spanNulls": false, | |
| "stacking": { | |
| "group": "A", | |
| "mode": "none" | |
| }, | |
| "thresholdsStyle": { | |
| "mode": "off" | |
| } | |
| }, | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 8, | |
| "w": 10, | |
| "x": 0, | |
| "y": 8 | |
| }, | |
| "id": 1, | |
| "options": { | |
| "legend": { | |
| "calcs": [], | |
| "displayMode": "list", | |
| "placement": "bottom", | |
| "showLegend": true | |
| }, | |
| "tooltip": { | |
| "mode": "single", | |
| "sort": "none" | |
| } | |
| }, | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "expr": "sum(increase(otela_calls_total{service_name=\"$site\"}[5m]))", | |
| "instant": false, | |
| "legendFormat": "Visites", | |
| "range": true, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Dernières Visites", | |
| "type": "timeseries" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "mappings": [], | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "blue", | |
| "value": 20 | |
| }, | |
| { | |
| "color": "purple", | |
| "value": 40 | |
| } | |
| ] | |
| }, | |
| "unit": "none" | |
| }, | |
| "overrides": [] | |
| }, | |
| "gridPos": { | |
| "h": 8, | |
| "w": 14, | |
| "x": 10, | |
| "y": 8 | |
| }, | |
| "id": 3, | |
| "options": { | |
| "displayMode": "gradient", | |
| "minVizHeight": 10, | |
| "minVizWidth": 0, | |
| "orientation": "horizontal", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showUnfilled": true, | |
| "valueMode": "color" | |
| }, | |
| "pluginVersion": "10.0.3", | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "editorMode": "code", | |
| "exemplar": false, | |
| "expr": "sort_desc(sum by (referrer) (otela_calls_total{service_name=\"$site\", referrer!=\"$site\"}) \n- \nsum by (referrer) (otela_calls_total{service_name=\"$site\", referrer!=\"$site\"} offset $__range or otela_calls_total{service_name=\"$site\", referrer!=\"$site\"} * 0)\n!= 0)", | |
| "instant": true, | |
| "legendFormat": "{{referrer}}", | |
| "range": false, | |
| "refId": "A" | |
| } | |
| ], | |
| "title": "Referrer", | |
| "type": "bargauge" | |
| } | |
| ], | |
| "refresh": "", | |
| "schemaVersion": 38, | |
| "style": "dark", | |
| "tags": [], | |
| "templating": { | |
| "list": [ | |
| { | |
| "current": {}, | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${DS_PROMETHEUS}" | |
| }, | |
| "definition": "label_values(service_name)", | |
| "hide": 1, | |
| "includeAll": false, | |
| "multi": false, | |
| "name": "site", | |
| "options": [], | |
| "query": { | |
| "query": "label_values(service_name)", | |
| "refId": "PrometheusVariableQueryEditor-VariableQuery" | |
| }, | |
| "refresh": 1, | |
| "regex": "", | |
| "skipUrlSync": false, | |
| "sort": 0, | |
| "type": "query" | |
| } | |
| ] | |
| }, | |
| "time": { | |
| "from": "now-1d/d", | |
| "to": "now-1d/d" | |
| }, | |
| "timepicker": {}, | |
| "timezone": "", | |
| "title": "Otela", | |
| "uid": "de16c497-19a4-4bfa-af96-e9ae5302447e", | |
| "version": 33, | |
| "weekStart": "" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| listen [::]:80; | |
| listen 443 ssl; | |
| listen [::]:443 ssl; | |
| http2 on; | |
| server_name collector.domain.fr; | |
| set $upstream http://opentelemetry:4318; | |
| location / { | |
| try_files $uri $uri/ @proxy; | |
| } | |
| location @proxy { | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-Host $host; | |
| proxy_set_header X-Forwarded-Port 443; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto https; | |
| proxy_set_header X-GeoIP-Latitude $geoip_latitude; | |
| proxy_set_header X-GeoIP-Longitude $geoip_longitude; | |
| proxy_pass $upstream; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| receivers: | |
| otlp/otela: | |
| protocols: | |
| http: | |
| endpoint: ':4318' | |
| include_metadata: true | |
| cors: | |
| allowed_origins: | |
| - http://* | |
| - https://* | |
| max_age: 7200 | |
| connectors: | |
| spanmetrics/otela: | |
| namespace: otela | |
| histogram: | |
| explicit: | |
| buckets: [6ms, 10ms, 100ms, 250ms, 500ms] | |
| dimensions: | |
| - name: ip | |
| - name: navigator | |
| - name: os | |
| - name: platform | |
| - name: referrer | |
| - name: title | |
| - name: latitude | |
| - name: longitude | |
| processors: | |
| batch: | |
| filter/otela: | |
| spans: | |
| include: | |
| match_type: strict | |
| services: | |
| - "blog.domain.fr" | |
| attributes/otela: | |
| actions: | |
| - key: referrer | |
| pattern: ^https?:\/\/(?P<dummy>[^@\n]+@)?(?P<referrer>[^:\/\n?]+) | |
| action: extract | |
| - key: dummy | |
| action: delete | |
| - key: referrer | |
| value: direct | |
| action: insert | |
| - key: ip | |
| from_context: X-Real-IP | |
| action: upsert | |
| - key: latitude | |
| from_context: X-GeoIP-Latitude | |
| action: upsert | |
| - key: longitude | |
| from_context: X-GeoIP-Longitude | |
| action: upsert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment