Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ services:
- 5999:5432/tcp
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=otel_demo
- POSTGRES_DB=tsdb
- POSTGRES_HOST_AUTH_METHOD=trust

promscale:
image: "timescale/promscale:0.11.0"
image: "timescale/promscale:latest"
ports:
- 9201:9201/tcp
- 9202:9202/tcp
Expand All @@ -24,13 +24,10 @@ services:
- timescaledb
environment:
PROMSCALE_DB_CONNECT_RETRIES: 10
PROMSCALE_WEB_TELEMETRY_PATH: /metrics-text
PROMSCALE_DB_URI: postgres://postgres:password@timescaledb:5432/otel_demo?sslmode=allow
PROMSCALE_ENABLE_FEATURE: tracing
PROMSCALE_TRACING_OTLP_SERVER_ADDRESS: 0.0.0.0:9202
PROMSCALE_DB_URI: postgres://postgres:password@timescaledb:5432/tsdb?sslmode=allow

jaeger:
image: jaegertracing/jaeger-query:1.30
image: jaegertracing/jaeger-query:1.35
ports:
- 16685:16685/tcp
- 16686:16686/tcp
Expand Down
2 changes: 1 addition & 1 deletion instrumented/collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM otel/opentelemetry-collector:0.43.0
FROM otel/opentelemetry-collector:0.55.0
COPY config.yaml /etc/otelcol/config.yaml
2 changes: 1 addition & 1 deletion instrumented/collector/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ service:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp]
exporters: [otlp]
2 changes: 1 addition & 1 deletion instrumented/digit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN pip3 install -r requirements.txt
COPY digit.py .
EXPOSE 5000
ENV FLASK_APP=digit
CMD ["flask", "run", "--host=0.0.0.0"]
CMD ["flask", "run", "--host", "0.0.0.0"]
2 changes: 1 addition & 1 deletion instrumented/generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN pip3 install -r requirements.txt
COPY generator.py .
EXPOSE 5000
ENV FLASK_APP=generator
CMD ["flask", "run", "--host=0.0.0.0"]
CMD ["flask", "run", "--host", "0.0.0.0"]
308 changes: 308 additions & 0 deletions instrumented/grafana/APM-dashboards/apm-dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
{
"__inputs": [
{
"name": "DS_TIMESCALEDB",
"label": "TimescaleDB / PostgreSQL data source",
"description": "",
"type": "datasource",
"pluginId": "postgres",
"pluginName": "PostgreSQL"
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 11,
"links": [
{
"asDropdown": false,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"promscale",
"apm"
],
"targetBlank": false,
"title": "Menu",
"tooltip": "",
"type": "dashboards",
"url": ""
}
],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "c4729dfb8ceeaa0372ef27403a3932695eee995d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Total exec time"
},
"properties": [
{
"id": "unit",
"value": "ms"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Avg exec time"
},
"properties": [
{
"id": "unit",
"value": "ms"
},
{
"id": "decimals",
"value": 2
}
]
},
{
"matcher": {
"id": "byName",
"options": "Source"
},
"properties": [
{
"id": "links",
"value": [
{
"title": "Show service overview",
"url": "/d/YWfN6wL7z/?var-service=${__value.raw}"
}
]
}
]
},
{
"matcher": {
"id": "byName",
"options": "Target"
},
"properties": [
{
"id": "links",
"value": [
{
"title": "Show service overview",
"url": "/d/YWfN6wL7z/?var-service=${__value.raw}"
}
]
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "8.3.3",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "c4729dfb8ceeaa0372ef27403a3932695eee995d"
},
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n p.service_name as \"Source\",\n k.service_name as \"Target\",\n k.span_name as \"Operation\",\n count(*) as \"Calls\",\n sum(k.duration_ms) as \"Total exec time\",\n avg(k.duration_ms) as \"Avg exec time\"\nFROM ps_trace.span p\nINNER JOIN ps_trace.span k\nON (p.trace_id = k.trace_id\nAND p.span_id = k.parent_span_id\nAND p.service_name != k.service_name)\nWHERE p.start_time >= NOW() - INTERVAL '10 minutes'\nAND k.start_time >= NOW() - INTERVAL '10 minutes'\nGROUP BY 1, 2, 3\nORDER BY 5 DESC",
"refId": "A",
"select": [
[
{
"params": [
"span_duration_ms"
],
"type": "column"
}
]
],
"table": "event",
"timeColumn": "\"time\"",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Service Dependencies (last 10 minutes)",
"type": "table"
},
{
"datasource": {
"type": "postgres",
"uid": "c4729dfb8ceeaa0372ef27403a3932695eee995d"
},
"description": "This maps shows all services sending traces and the interactions between them.\nEach arrow represents a service calling a specific operation in another service. The legend in the arrows includes the requests per second for that interaction. If you are downsampling your traces before sending them to Promscale, then the number of requests per second will not be accurate but you'll be able to see how it compares to other operations.",
"gridPos": {
"h": 19,
"w": 24,
"x": 0,
"y": 8
},
"id": 2,
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "c4729dfb8ceeaa0372ef27403a3932695eee995d"
},
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT \n service_name as id,\n service_name as title\nFROM ps_trace.span\nWHERE start_time >= NOW() - INTERVAL '10 minutes'\nGROUP BY service_name",
"refId": "A",
"select": [
[
{
"params": [
"span_duration_ms"
],
"type": "column"
}
]
],
"table": "event",
"timeColumn": "\"time\"",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
},
{
"datasource": {
"type": "postgres",
"uid": "c4729dfb8ceeaa0372ef27403a3932695eee995d"
},
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n p.service_name || '->' || k.service_name || ':' || k.span_name as id,\n p.service_name as source,\n k.service_name as target,\n k.span_name as \"mainStat\",\n count(*) as \"secondaryStat\"\nFROM ps_trace.span p\nINNER JOIN ps_trace.span k\nON (p.trace_id = k.trace_id\nAND p.span_id = k.parent_span_id\nAND p.service_name != k.service_name)\nWHERE p.start_time >= NOW() - INTERVAL '10 minutes'\nAND k.start_time >= NOW() - INTERVAL '10 minutes'\nGROUP BY 1, 2, 3, 4",
"refId": "B",
"select": [
[
{
"params": [
"span_duration_ms"
],
"type": "column"
}
]
],
"table": "event",
"timeColumn": "\"time\"",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Service Map (last 10 minutes)",
"type": "nodeGraph"
}
],
"schemaVersion": 34,
"style": "dark",
"tags": [
"promscale",
"apm"
],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"hidden": true
},
"timezone": "",
"title": "[3] Service Map",
"uid": "K03UKvPnz",
"version": 13,
"weekStart": ""
}
Loading