From 49a06241b408b78c4cea1e947dc45ea3c26eeafc Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 12 Dec 2024 19:14:42 +0000 Subject: [PATCH 1/4] update collector to the latest release --- samples/instrumentation-quickstart/docker-compose.yaml | 2 +- samples/instrumentation-quickstart/otel-collector-config.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/instrumentation-quickstart/docker-compose.yaml b/samples/instrumentation-quickstart/docker-compose.yaml index e2e693c5..17a68846 100644 --- a/samples/instrumentation-quickstart/docker-compose.yaml +++ b/samples/instrumentation-quickstart/docker-compose.yaml @@ -28,7 +28,7 @@ services: ports: - 8080 otelcol: - image: otel/opentelemetry-collector-contrib:0.92.0 + image: otel/opentelemetry-collector-contrib:0.115.1 volumes: - ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro - logs:/var/log:ro diff --git a/samples/instrumentation-quickstart/otel-collector-config.yaml b/samples/instrumentation-quickstart/otel-collector-config.yaml index ae3bd2c4..002d5cea 100644 --- a/samples/instrumentation-quickstart/otel-collector-config.yaml +++ b/samples/instrumentation-quickstart/otel-collector-config.yaml @@ -85,12 +85,12 @@ receivers: exporters: # Export logs and traces using the standard googelcloud exporter googlecloud: - project: $GOOGLE_CLOUD_PROJECT + project: ${GOOGLE_CLOUD_PROJECT} log: default_log_name: "opentelemetry.io/collector-exported-log" # Export metrics to Google Managed service for Prometheus googlemanagedprometheus: - project: $GOOGLE_CLOUD_PROJECT + project: ${GOOGLE_CLOUD_PROJECT} processors: # Batch telemetry together to more efficiently send to GCP From 1ec1c177df94568c22f5eb8187791b36f4ec2b0a Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 13 Dec 2024 01:59:42 +0000 Subject: [PATCH 2/4] update sample dependencies, which adds http route to http metrics --- .../requirements.txt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/instrumentation-quickstart/requirements.txt b/samples/instrumentation-quickstart/requirements.txt index ca57d1f6..158dcff3 100644 --- a/samples/instrumentation-quickstart/requirements.txt +++ b/samples/instrumentation-quickstart/requirements.txt @@ -1,11 +1,11 @@ # Dependencies require for the instrumentation sample -flask==3.0.2 -requests==2.31.0 -opentelemetry-api==1.24.0 -opentelemetry-sdk==1.24.0 -opentelemetry-exporter-otlp-proto-http==1.24.0 -opentelemetry-instrumentation-flask==0.45b0 -opentelemetry-instrumentation-requests==0.45b0 -opentelemetry-instrumentation-logging==0.45b0 -python-json-logger==2.0.7 -gunicorn==22.0.0 +flask==3.1.0 +requests==2.32.3 +opentelemetry-api==1.29.0 +opentelemetry-sdk==1.29.0 +opentelemetry-exporter-otlp-proto-http==1.29.0 +opentelemetry-instrumentation-flask==0.50b0 +opentelemetry-instrumentation-requests==0.50b0 +opentelemetry-instrumentation-logging==0.50b0 +python-json-logger==3.2.0 +gunicorn==23.0.0 From 7519d6f8f9852ad46ea8cae0bf1d2c51d38085fd Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 13 Dec 2024 02:41:09 +0000 Subject: [PATCH 3/4] switch to exponential histograms --- samples/instrumentation-quickstart/docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/instrumentation-quickstart/docker-compose.yaml b/samples/instrumentation-quickstart/docker-compose.yaml index 17a68846..85ee335b 100644 --- a/samples/instrumentation-quickstart/docker-compose.yaml +++ b/samples/instrumentation-quickstart/docker-compose.yaml @@ -21,6 +21,7 @@ services: - OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318 - OTEL_SERVICE_NAME=otel-quickstart-python - OTEL_METRIC_EXPORT_INTERVAL=5000 + - OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram volumes: - logs:/var/log:rw depends_on: From b386f1384fa330cb904897eeaa731b30346d2753 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 18 Dec 2024 14:37:53 +0000 Subject: [PATCH 4/4] expose prometheus exporter for test --- .../instrumentation-quickstart/otel-collector-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/instrumentation-quickstart/otel-collector-config.yaml b/samples/instrumentation-quickstart/otel-collector-config.yaml index 002d5cea..90fda8c0 100644 --- a/samples/instrumentation-quickstart/otel-collector-config.yaml +++ b/samples/instrumentation-quickstart/otel-collector-config.yaml @@ -111,6 +111,14 @@ processors: detectors: ["env", "gcp"] service: + telemetry: + metrics: + readers: + - pull: + exporter: + prometheus: + host: '0.0.0.0' + port: 8888 pipelines: traces: receivers: ["otlp"]