From 2ce0aaedb5a4fccb5ad393f91c075c3f2d1b795e Mon Sep 17 00:00:00 2001 From: Vherremi Date: Thu, 30 Oct 2025 11:21:00 -0700 Subject: [PATCH 01/45] Testing .NET custom metrics --- .github/workflows/dotnet-ec2-default-test.yml | 17 ++ .github/workflows/test.yml | 23 ++ .../Controllers/AppController.cs | 41 +++- .../dotnet/asp_frontend_service/Startup.cs | 16 ++ .../asp_frontend_service.csproj | 4 + .../PredefinedExpectedTemplate.java | 3 + .../default/aws-otel-custom-metrics.mustache | 228 ++++++++++++++++++ .../ec2/default/custom-metric-validation.yml | 6 + 8 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache create mode 100644 validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index a1e76e5f3..9a4242e60 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -229,6 +229,23 @@ jobs: --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} --rollup' + - name: Validate custom metrics + id: CWagent-metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c dotnet/ec2/default/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8081 + --region ${{ env.E2E_TEST_AWS_REGION }} + --metric-namespace CWAgent + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name dotnet-sample-application-${{ env.TESTING_ID }} + --remote-service-name dotnet-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + - name: Validate generated traces id: trace-validation if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..25973f837 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the Enablement test for App Signals. +# It is meant to be called from another workflow. +# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview +name: Test +on: + push: + branches: + - dotnet_Custom_metrics + +permissions: + id-token: write + contents: read + +jobs: + python-ec2-default: + uses: ./.github/workflows/dotnet-ec2-default-test.yml + secrets: inherit + with: + caller-workflow-name: 'test' + aws-region: 'us-east-1' \ No newline at end of file diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index c4427f9ed..c6d05ae9f 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -9,6 +9,9 @@ using Amazon.S3; using Microsoft.AspNetCore.Mvc; using Amazon.S3.Model; +using System.Diagnostics.Metrics; +using System.Collections.Generic; + namespace asp_frontend_service.Controllers; @@ -22,6 +25,16 @@ public class AppController : ControllerBase private static bool threadStarted = false; private readonly AmazonS3Client s3Client = new AmazonS3Client(); private readonly HttpClient httpClient = new HttpClient(); + private static readonly Meter meter = new Meter("myMeter"); + private static readonly Counter agentBasedCounter = meter.CreateCounter("agent_based_counter"); + private static readonly Histogram agentBasedHistogram = meter.CreateHistogram("agent_based_histogram"); + private static readonly UpDownCounter agentBasedGauge = meter.CreateUpDownCounter("agent_based_gauge"); + + // Custom pipeline metrics + private static readonly Meter customPipelineMeter = new Meter("customPipelineMeter"); + private static readonly Counter customPipelineCounter = customPipelineMeter.CreateCounter("custom_pipeline_counter"); + private static readonly Histogram customPipelineHistogram = customPipelineMeter.CreateHistogram("custom_pipeline_histogram"); + private static readonly UpDownCounter customPipelineGauge = customPipelineMeter.CreateUpDownCounter("custom_pipeline_gauge"); private static readonly Thread thread = new Thread(() => { @@ -69,7 +82,33 @@ public string OutgoingHttp() [Route("/aws-sdk-call")] public string AWSSDKCall([FromQuery] string testingId) { - var request = new GetBucketLocationRequest() + var random = new Random(); + + // Agent-based metrics + var histogramValue = random.NextDouble() * 100; + var gaugeValue = random.Next(-10, 11); + agentBasedCounter.Add(1, new KeyValuePair("Operation", "counter")); + agentBasedHistogram.Record(histogramValue, new KeyValuePair("Operation", "histogram")); + agentBasedGauge.Add(gaugeValue, new KeyValuePair("Operation", "gauge")); + + // Custom pipeline metrics with required Telemetry.Source attribute + var pipelineHistogramValue = random.NextDouble() * 50; + var pipelineGaugeValue = random.Next(-5, 6); + var pipelineAttributes = new KeyValuePair[] { + new("Operation", "pipeline_counter"), + new("Telemetry.Source", "UserMetric"), + }; + var pipelineHistogramAttributes = new KeyValuePair[] { + new("Operation", "pipeline_histogram"), + new("Telemetry.Source", "UserMetric"), + }; + var pipelineGaugeAttributes = new KeyValuePair[] { + new("Operation", "pipeline_gauge"), + new("Telemetry.Source", "UserMetric"), + }; + + + var request = new GetBucketLocationRequest() { BucketName = testingId }; diff --git a/sample-apps/dotnet/asp_frontend_service/Startup.cs b/sample-apps/dotnet/asp_frontend_service/Startup.cs index 657099447..4e9d105fd 100644 --- a/sample-apps/dotnet/asp_frontend_service/Startup.cs +++ b/sample-apps/dotnet/asp_frontend_service/Startup.cs @@ -7,6 +7,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using OpenTelemetry.Metrics; +using OpenTelemetry.Resources; +using System.Collections.Generic; namespace asp_frontend_service; @@ -25,6 +28,19 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); + + // Configure OpenTelemetry for custom pipeline metrics + services.AddOpenTelemetry() + .ConfigureResource(resource => resource + .AddService(Environment.GetEnvironmentVariable("SERVICE_NAME") ?? "dotnet-sample-application") + .AddAttributes(new Dictionary { { "Telemetry.Source", "UserMetric" } })) + .WithMetrics(metrics => metrics + .AddMeter("customPipelineMeter") + .AddOtlpExporter(options => { + options.Endpoint = new Uri(Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") ?? "http://localhost:4318/v1/metrics"); + Console.WriteLine($"Custom pipeline OTLP endpoint: {options.Endpoint}"); + }) + .AddConsoleExporter()); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index e1a7b7816..25c905d07 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -8,6 +8,10 @@ + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java index 9346119ee..99c896a8d 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -315,6 +315,9 @@ public enum PredefinedExpectedTemplate implements FileConfig { DOTNET_EC2_WINDOWS_DEFAULT_AWS_SDK_CALL_METRIC("/expected-data-template/dotnet/ec2/windows/aws-sdk-call-metric.mustache"), DOTNET_EC2_WINDOWS_DEFAULT_AWS_SDK_CALL_TRACE("/expected-data-template/dotnet/ec2/windows/aws-sdk-call-trace.mustache"), + /** Python EC2 Default Custom Metrics Test Case Validations */ + DOTNET_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache"), + DOTNET_EC2_WINDOWS_DEFAULT_REMOTE_SERVICE_LOG("/expected-data-template/dotnet/ec2/windows/remote-service-log.mustache"), DOTNET_EC2_WINDOWS_DEFAULT_REMOTE_SERVICE_METRIC("/expected-data-template/dotnet/ec2/windows/remote-service-metric.mustache"), // Because of a time sync issue, block the remote service trace check for now diff --git a/validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache new file mode 100644 index 000000000..9fc5d6480 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache @@ -0,0 +1,228 @@ +# OpenTelemetry Custom Metrics Validation Templates - AWS SDK Call Only +# ANY_VALUE defines a string to = 'ANY_VALUE' to pass validation testing +# Custom export templates +- + metricName: agent_based_counter + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: aws.local.service + value: {{serviceName}} + - + name: cloud.region + value: {{region}} + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: counter + - + name: host.type + value: ANY_VALUE + - + name: cloud.availability_zone + value: ANY_VALUE + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: cloud.provider + value: aws + - + name: cloud.account.id + value: {{accountId}} + - + name: host.name + value: ANY_VALUE + - + name: telemetry.sdk.version + value: ANY_VALUE + - + name: host.id + value: ANY_VALUE + - + name: telemetry.auto.version + value: ANY_VALUE + - + name: cloud.platform + value: aws_ec2 +- + metricName: agent_based_histogram + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: aws.local.service + value: {{serviceName}} + - + name: cloud.region + value: {{region}} + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: histogram + - + name: host.type + value: ANY_VALUE + - + name: cloud.availability_zone + value: ANY_VALUE + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: cloud.provider + value: aws + - + name: cloud.account.id + value: {{accountId}} + - + name: host.name + value: ANY_VALUE + - + name: telemetry.sdk.version + value: ANY_VALUE + - + name: host.id + value: ANY_VALUE + - + name: telemetry.auto.version + value: ANY_VALUE + - + name: cloud.platform + value: aws_ec2 +- + metricName: agent_based_gauge + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: aws.local.service + value: {{serviceName}} + - + name: cloud.region + value: {{region}} + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: gauge + - + name: host.type + value: ANY_VALUE + - + name: cloud.availability_zone + value: ANY_VALUE + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: cloud.provider + value: aws + - + name: cloud.account.id + value: {{accountId}} + - + name: host.name + value: ANY_VALUE + - + name: telemetry.sdk.version + value: ANY_VALUE + - + name: host.id + value: ANY_VALUE + - + name: telemetry.auto.version + value: ANY_VALUE + - + name: cloud.platform + value: aws_ec2 + value: aws_ec2 + +# Export pipeline metrics +- + metricName: custom_pipeline_counter + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: pipeline_counter + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: telemetry.sdk.version + value: ANY_VALUE +- + metricName: custom_pipeline_histogram + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: pipeline_histogram + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: telemetry.sdk.version + value: ANY_VALUE +- + metricName: custom_pipeline_gauge + namespace: {{metricNamespace}} + dimensions: + - + name: deployment.environment.name + value: ec2:default + - + name: service.name + value: {{serviceName}} + - + name: Operation + value: pipeline_gauge + - + name: telemetry.sdk.name + value: opentelemetry + - + name: telemetry.sdk.language + value: dotnet + - + name: telemetry.sdk.version + value: ANY_VALUE \ No newline at end of file diff --git a/validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml b/validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml new file mode 100644 index 000000000..04227aecc --- /dev/null +++ b/validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml @@ -0,0 +1,6 @@ +- + validationType: "cw-metric" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "DOTNET_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC" \ No newline at end of file From 7e9982f52ed84ff028508df2f14b599cff4e5cee Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 09:49:26 -0800 Subject: [PATCH 02/45] dotnet-ec2-default test 1 --- .github/workflows/dotnet-ec2-default-test.yml | 10 +-- .github/workflows/test.yml | 4 +- .../Controllers/AppController.cs | 82 ++++++++++++++----- terraform/dotnet/ec2/default/main.tf | 15 ++-- .../PredefinedExpectedTemplate.java | 2 +- .../ec2/default/custom-metric-validation.yml | 0 6 files changed, 78 insertions(+), 35 deletions(-) rename validator/src/main/resources/validations/{node => dotnet}/ec2/default/custom-metric-validation.yml (100%) diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index 9a4242e60..493c6df7c 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -230,9 +230,9 @@ jobs: --rollup' - name: Validate custom metrics - id: CWagent-metric-validation - if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - run: ./gradlew validator:run --args='-c dotnet/ec2/default/metric-validation.yml + id: cwagent-metric-validation + if: (success() || steps.log-validation.outcome == 'failure' || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c dotnet/ec2/default/custom-metric-validation.yml --testing-id ${{ env.TESTING_ID }} --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8081 @@ -248,7 +248,7 @@ jobs: - name: Validate generated traces id: trace-validation - if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure' || steps.custom-metric-validation.outcome == 'failure') && !cancelled() run: ./gradlew validator:run --args='-c dotnet/ec2/default/trace-validation.yml --testing-id ${{ env.TESTING_ID }} --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} @@ -275,7 +275,7 @@ jobs: if: always() id: validation-result run: | - if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then + if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.custom-metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then echo "validation-result=success" >> $GITHUB_OUTPUT else echo "validation-result=failure" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25973f837..9f5f25f78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,14 +8,14 @@ name: Test on: push: branches: - - dotnet_Custom_metrics + - dotnet_custom_metrics permissions: id-token: write contents: read jobs: - python-ec2-default: + dotnet-ec2-default: uses: ./.github/workflows/dotnet-ec2-default-test.yml secrets: inherit with: diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index c6d05ae9f..2ed3b5c91 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -11,6 +11,10 @@ using Amazon.S3.Model; using System.Diagnostics.Metrics; using System.Collections.Generic; +using OpenTelemetry; +using OpenTelemetry.Metrics; +using OpenTelemetry.Resources; +using OpenTelemetry.Exporter; namespace asp_frontend_service.Controllers; @@ -30,11 +34,48 @@ public class AppController : ControllerBase private static readonly Histogram agentBasedHistogram = meter.CreateHistogram("agent_based_histogram"); private static readonly UpDownCounter agentBasedGauge = meter.CreateUpDownCounter("agent_based_gauge"); - // Custom pipeline metrics - private static readonly Meter customPipelineMeter = new Meter("customPipelineMeter"); - private static readonly Counter customPipelineCounter = customPipelineMeter.CreateCounter("custom_pipeline_counter"); - private static readonly Histogram customPipelineHistogram = customPipelineMeter.CreateHistogram("custom_pipeline_histogram"); - private static readonly UpDownCounter customPipelineGauge = customPipelineMeter.CreateUpDownCounter("custom_pipeline_gauge"); + // Custom pipeline metrics - only create if specific env vars exist + private static readonly Meter? pipelineMeter; + private static readonly Counter? customPipelineCounter; + private static readonly Histogram? customPipelineHistogram; + private static readonly UpDownCounter? customPipelineGauge; + private static readonly MeterProvider? pipelineMeterProvider; + + static AppController() + { + var serviceName = Environment.GetEnvironmentVariable("SERVICE_NAME"); + var deploymentEnv = Environment.GetEnvironmentVariable("DEPLOYMENT_ENVIRONMENT_NAME"); + + if (!string.IsNullOrEmpty(serviceName) && !string.IsNullOrEmpty(deploymentEnv)) + { + var pipelineResource = ResourceBuilder.CreateDefault() + .AddAttributes(new Dictionary + { + ["service.name"] = serviceName, + ["deployment.environment.name"] = deploymentEnv + }) + .Build(); + + pipelineMeterProvider = Sdk.CreateMeterProviderBuilder() + .SetResourceBuilder(ResourceBuilder.CreateDefault().AddAttributes(new Dictionary + { + ["service.name"] = serviceName, + ["deployment.environment.name"] = deploymentEnv + })) + .AddOtlpExporter(options => + { + options.Endpoint = new Uri("http://localhost:4317"); + options.Protocol = OtlpExportProtocol.Grpc; + }) + .AddMeter("myMeter") + .Build(); + + pipelineMeter = new Meter("myMeter"); + customPipelineCounter = pipelineMeter.CreateCounter("custom_pipeline_counter", "1", "pipeline export counter"); + customPipelineHistogram = pipelineMeter.CreateHistogram("custom_pipeline_histogram", "ms", "pipeline export histogram"); + customPipelineGauge = pipelineMeter.CreateUpDownCounter("custom_pipeline_gauge", "1", "pipeline export gauge"); + } + } private static readonly Thread thread = new Thread(() => { @@ -63,7 +104,6 @@ public AppController() { if (!threadStarted) { - Console.WriteLine("Starting thread"); threadStarted = true; thread.Start(); } @@ -87,27 +127,27 @@ public string AWSSDKCall([FromQuery] string testingId) // Agent-based metrics var histogramValue = random.NextDouble() * 100; var gaugeValue = random.Next(-10, 11); + agentBasedCounter.Add(1, new KeyValuePair("Operation", "counter")); agentBasedHistogram.Record(histogramValue, new KeyValuePair("Operation", "histogram")); agentBasedGauge.Add(gaugeValue, new KeyValuePair("Operation", "gauge")); - // Custom pipeline metrics with required Telemetry.Source attribute - var pipelineHistogramValue = random.NextDouble() * 50; - var pipelineGaugeValue = random.Next(-5, 6); - var pipelineAttributes = new KeyValuePair[] { - new("Operation", "pipeline_counter"), - new("Telemetry.Source", "UserMetric"), - }; - var pipelineHistogramAttributes = new KeyValuePair[] { - new("Operation", "pipeline_histogram"), - new("Telemetry.Source", "UserMetric"), - }; - var pipelineGaugeAttributes = new KeyValuePair[] { - new("Operation", "pipeline_gauge"), - new("Telemetry.Source", "UserMetric"), - }; + // Custom pipeline metrics - only record if pipeline exists + if (customPipelineCounter != null) + { + customPipelineCounter.Add(1, new KeyValuePair("Operation", "pipeline_counter")); + customPipelineHistogram?.Record(random.Next(100, 1001), new KeyValuePair("Operation", "pipeline_histogram")); + customPipelineGauge?.Add(random.Next(-10, 11), new KeyValuePair("Operation", "pipeline_gauge")); + }nsole.WriteLine("[PIPELINE] Metrics recorded - will be exported via OTLP to localhost:4317"); + } + var bucketName = "e2e-test-bucket-name"; + if (!string.IsNullOrEmpty(testingId)) + { + bucketName += "-" + testingId; + } + var request = new GetBucketLocationRequest() { BucketName = testingId diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 17bb0e478..875084802 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -132,8 +132,8 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app-delete-me.zip + unzip -o dotnet-sample-app-delete-me.zip # Get Absolute Path current_dir=$(pwd) @@ -153,8 +153,11 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics - export OTEL_METRICS_EXPORTER=none - export OTEL_RESOURCE_ATTRIBUTES=service.name=dotnet-sample-application-${var.test_id} + export OTEL_METRICS_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4317 + export SERVICE_NAME='dotnet-sample-application-${var.test_id}' + export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' + export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on @@ -240,8 +243,8 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app-delete-me.zip + unzip -o dotnet-sample-app-delete-me.zip # Get Absolute Path current_dir=$(pwd) diff --git a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java index 99c896a8d..659d7e220 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -315,7 +315,7 @@ public enum PredefinedExpectedTemplate implements FileConfig { DOTNET_EC2_WINDOWS_DEFAULT_AWS_SDK_CALL_METRIC("/expected-data-template/dotnet/ec2/windows/aws-sdk-call-metric.mustache"), DOTNET_EC2_WINDOWS_DEFAULT_AWS_SDK_CALL_TRACE("/expected-data-template/dotnet/ec2/windows/aws-sdk-call-trace.mustache"), - /** Python EC2 Default Custom Metrics Test Case Validations */ + /** DOTNET EC2 Default Custom Metrics Test Case Validations */ DOTNET_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache"), DOTNET_EC2_WINDOWS_DEFAULT_REMOTE_SERVICE_LOG("/expected-data-template/dotnet/ec2/windows/remote-service-log.mustache"), diff --git a/validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml b/validator/src/main/resources/validations/dotnet/ec2/default/custom-metric-validation.yml similarity index 100% rename from validator/src/main/resources/validations/node/ec2/default/custom-metric-validation.yml rename to validator/src/main/resources/validations/dotnet/ec2/default/custom-metric-validation.yml From a8a5d5f17fa4eda6a72427e159b586084dc81dcc Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 09:52:01 -0800 Subject: [PATCH 03/45] Updating branch name in test file --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f5f25f78..acd84982d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ name: Test on: push: branches: - - dotnet_custom_metrics + - DOTNET_Custom_metrics permissions: id-token: write From 4c7abceb39b7a08e2f939359c7707025cdd6bd81 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 10:04:31 -0800 Subject: [PATCH 04/45] dotnet-ec2-default test 2 --- .../{node => dotnet}/ec2/default/aws-otel-custom-metrics.mustache | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename validator/src/main/resources/expected-data-template/{node => dotnet}/ec2/default/aws-otel-custom-metrics.mustache (100%) diff --git a/validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache similarity index 100% rename from validator/src/main/resources/expected-data-template/node/ec2/default/aws-otel-custom-metrics.mustache rename to validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache From 557bc18781356fb6a71bae8f3b4897d0145ed82d Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 10:28:27 -0800 Subject: [PATCH 05/45] dotnet-ec2-default test 3, adding otlp config --- .../asp_frontend_service/Controllers/AppController.cs | 1 - terraform/node/ec2/default/amazon-cloudwatch-agent.json | 6 +++++- .../dotnet/ec2/default/aws-otel-custom-metrics.mustache | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index 2ed3b5c91..83f06edbe 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -138,7 +138,6 @@ public string AWSSDKCall([FromQuery] string testingId) customPipelineCounter.Add(1, new KeyValuePair("Operation", "pipeline_counter")); customPipelineHistogram?.Record(random.Next(100, 1001), new KeyValuePair("Operation", "pipeline_histogram")); customPipelineGauge?.Add(random.Next(-10, 11), new KeyValuePair("Operation", "pipeline_gauge")); - }nsole.WriteLine("[PIPELINE] Metrics recorded - will be exported via OTLP to localhost:4317"); } diff --git a/terraform/node/ec2/default/amazon-cloudwatch-agent.json b/terraform/node/ec2/default/amazon-cloudwatch-agent.json index a98a40d36..f65bfe32e 100644 --- a/terraform/node/ec2/default/amazon-cloudwatch-agent.json +++ b/terraform/node/ec2/default/amazon-cloudwatch-agent.json @@ -10,7 +10,11 @@ }, "logs": { "metrics_collected": { - "application_signals": {} + "application_signals": {}, + "otlp": { + "grpc_endpoint": "0.0.0.0:4317", + "http_endpoint": "0.0.0.0:4318" + } } } } \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache index 9fc5d6480..f0335f8e1 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache @@ -157,7 +157,6 @@ - name: cloud.platform value: aws_ec2 - value: aws_ec2 # Export pipeline metrics - From ee77b94bee55e6c9bb49a1ddccaa3490b3779805 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 10:47:02 -0800 Subject: [PATCH 06/45] dotnet-ec2-default test 4, testing main.tf change --- terraform/dotnet/ec2/default/main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 875084802..cd31a747c 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,7 +154,8 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4317 + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=localhost:4317 + export OTEL_EXPORTER_OTLP_METRICS_INSECURE=true export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" From 07336593334bbd627385fcfc0c8e7b9b7d5caa79 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 10:57:01 -0800 Subject: [PATCH 07/45] dotnet-ec2-default test 5, testing main.tf change --- terraform/dotnet/ec2/default/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index cd31a747c..00ff94809 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -155,6 +155,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=localhost:4317 + export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_METRICS_INSECURE=true export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' From b48ec4535ced5510686db023b58d0353b594791f Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 11:33:22 -0800 Subject: [PATCH 08/45] dotnet-ec2-default test 6 --- .../asp_frontend_service/Controllers/AppController.cs | 8 ++++---- sample-apps/dotnet/asp_frontend_service/Startup.cs | 2 +- terraform/dotnet/ec2/default/main.tf | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index 83f06edbe..ccb091977 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -64,13 +64,13 @@ static AppController() })) .AddOtlpExporter(options => { - options.Endpoint = new Uri("http://localhost:4317"); - options.Protocol = OtlpExportProtocol.Grpc; + options.Endpoint = new Uri("http://localhost:4318/v1/metrics"); + options.Protocol = OtlpExportProtocol.HttpProtobuf; }) - .AddMeter("myMeter") + .AddMeter("customPipelineMeter") .Build(); - pipelineMeter = new Meter("myMeter"); + pipelineMeter = new Meter("customPipelineMeter"); customPipelineCounter = pipelineMeter.CreateCounter("custom_pipeline_counter", "1", "pipeline export counter"); customPipelineHistogram = pipelineMeter.CreateHistogram("custom_pipeline_histogram", "ms", "pipeline export histogram"); customPipelineGauge = pipelineMeter.CreateUpDownCounter("custom_pipeline_gauge", "1", "pipeline export gauge"); diff --git a/sample-apps/dotnet/asp_frontend_service/Startup.cs b/sample-apps/dotnet/asp_frontend_service/Startup.cs index 4e9d105fd..5647af21c 100644 --- a/sample-apps/dotnet/asp_frontend_service/Startup.cs +++ b/sample-apps/dotnet/asp_frontend_service/Startup.cs @@ -35,7 +35,7 @@ public void ConfigureServices(IServiceCollection services) .AddService(Environment.GetEnvironmentVariable("SERVICE_NAME") ?? "dotnet-sample-application") .AddAttributes(new Dictionary { { "Telemetry.Source", "UserMetric" } })) .WithMetrics(metrics => metrics - .AddMeter("customPipelineMeter") + .AddMeter("myMeter") .AddOtlpExporter(options => { options.Endpoint = new Uri(Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") ?? "http://localhost:4318/v1/metrics"); Console.WriteLine($"Custom pipeline OTLP endpoint: {options.Endpoint}"); diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 00ff94809..b5f5ad6cc 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,9 +154,8 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=localhost:4317 - export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=grpc - export OTEL_EXPORTER_OTLP_METRICS_INSECURE=true + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics + export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" From a31fda0397d3a9f927cb921ec9f6f9f62dd43874 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 12:13:37 -0800 Subject: [PATCH 09/45] dotnet-ec2-default test 7 --- terraform/dotnet/ec2/default/amazon-cloudwatch-agent.json | 6 +++++- terraform/node/ec2/default/amazon-cloudwatch-agent.json | 6 +----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/terraform/dotnet/ec2/default/amazon-cloudwatch-agent.json b/terraform/dotnet/ec2/default/amazon-cloudwatch-agent.json index a98a40d36..f65bfe32e 100644 --- a/terraform/dotnet/ec2/default/amazon-cloudwatch-agent.json +++ b/terraform/dotnet/ec2/default/amazon-cloudwatch-agent.json @@ -10,7 +10,11 @@ }, "logs": { "metrics_collected": { - "application_signals": {} + "application_signals": {}, + "otlp": { + "grpc_endpoint": "0.0.0.0:4317", + "http_endpoint": "0.0.0.0:4318" + } } } } \ No newline at end of file diff --git a/terraform/node/ec2/default/amazon-cloudwatch-agent.json b/terraform/node/ec2/default/amazon-cloudwatch-agent.json index f65bfe32e..a98a40d36 100644 --- a/terraform/node/ec2/default/amazon-cloudwatch-agent.json +++ b/terraform/node/ec2/default/amazon-cloudwatch-agent.json @@ -10,11 +10,7 @@ }, "logs": { "metrics_collected": { - "application_signals": {}, - "otlp": { - "grpc_endpoint": "0.0.0.0:4317", - "http_endpoint": "0.0.0.0:4318" - } + "application_signals": {} } } } \ No newline at end of file From 04e1c9014ae60dfd911492c21989290b220e3e87 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Mon, 10 Nov 2025 15:03:48 -0800 Subject: [PATCH 10/45] dotnet-ec2-default test 8 --- .../asp_frontend_service/Controllers/AppController.cs | 4 ++-- sample-apps/dotnet/asp_frontend_service/Startup.cs | 7 +++++-- .../asp_frontend_service/asp_frontend_service.csproj | 1 + terraform/dotnet/ec2/default/main.tf | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index ccb091977..a77cc768a 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -67,10 +67,10 @@ static AppController() options.Endpoint = new Uri("http://localhost:4318/v1/metrics"); options.Protocol = OtlpExportProtocol.HttpProtobuf; }) - .AddMeter("customPipelineMeter") + .AddMeter("myMeter") .Build(); - pipelineMeter = new Meter("customPipelineMeter"); + pipelineMeter = new Meter("myMeter"); customPipelineCounter = pipelineMeter.CreateCounter("custom_pipeline_counter", "1", "pipeline export counter"); customPipelineHistogram = pipelineMeter.CreateHistogram("custom_pipeline_histogram", "ms", "pipeline export histogram"); customPipelineGauge = pipelineMeter.CreateUpDownCounter("custom_pipeline_gauge", "1", "pipeline export gauge"); diff --git a/sample-apps/dotnet/asp_frontend_service/Startup.cs b/sample-apps/dotnet/asp_frontend_service/Startup.cs index 5647af21c..8bea30b91 100644 --- a/sample-apps/dotnet/asp_frontend_service/Startup.cs +++ b/sample-apps/dotnet/asp_frontend_service/Startup.cs @@ -35,12 +35,15 @@ public void ConfigureServices(IServiceCollection services) .AddService(Environment.GetEnvironmentVariable("SERVICE_NAME") ?? "dotnet-sample-application") .AddAttributes(new Dictionary { { "Telemetry.Source", "UserMetric" } })) .WithMetrics(metrics => metrics + .AddAspNetCoreInstrumentation() .AddMeter("myMeter") .AddOtlpExporter(options => { options.Endpoint = new Uri(Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") ?? "http://localhost:4318/v1/metrics"); - Console.WriteLine($"Custom pipeline OTLP endpoint: {options.Endpoint}"); }) - .AddConsoleExporter()); + .AddConsoleExporter((exporterOptions, metricReaderOptions) => + { + metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000; + })); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index 25c905d07..7f2bb0ebc 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -12,6 +12,7 @@ + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index b5f5ad6cc..bc27ee9e5 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,6 +154,7 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp + export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeter export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export SERVICE_NAME='dotnet-sample-application-${var.test_id}' From 2799f0bda820256ddb60b438de786b570bc39875 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Tue, 11 Nov 2025 21:54:32 -0800 Subject: [PATCH 11/45] dotnet-ec2-default test 9 --- .github/workflows/dotnet-ec2-default-test.yml | 2 +- terraform/dotnet/ec2/default/main.tf | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index 493c6df7c..3dba13ae4 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -38,7 +38,7 @@ env: E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} DOTNET_VERSION: ${{ inputs.dotnet-version }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-delete-me.zip METRIC_NAMESPACE: ApplicationSignals LOG_GROUP_NAME: /aws/application-signals/data ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index bc27ee9e5..405488176 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -160,6 +160,8 @@ resource "null_resource" "main_service_setup" { export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" + export AWS_REGION="$${AWS_REGION}" + export TESTING_ID="$${TESTING_ID}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From e532922eebb1e27716b14798ed0498f5151edd20 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Tue, 11 Nov 2025 22:29:27 -0800 Subject: [PATCH 12/45] dotnet-ec2-default test 10 --- terraform/dotnet/ec2/default/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 405488176..2c77c050e 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,7 +154,6 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeter export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export SERVICE_NAME='dotnet-sample-application-${var.test_id}' From 36082d9c7f34ca7cc559ae5a58026b9853ddccb4 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 07:53:03 -0800 Subject: [PATCH 13/45] dotnet-ec2-default test 11 --- terraform/dotnet/ec2/default/main.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 2c77c050e..ac2eea487 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -151,8 +151,8 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/metrics + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf @@ -160,7 +160,6 @@ resource "null_resource" "main_service_setup" { export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" export AWS_REGION="$${AWS_REGION}" - export TESTING_ID="$${TESTING_ID}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From 77a85d3ed4dccfb79b313883695a2202e062ffbd Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 08:05:14 -0800 Subject: [PATCH 14/45] dotnet-ec2-default test 12 --- .../asp_frontend_service/asp_frontend_service.csproj | 12 ++++++------ terraform/dotnet/ec2/default/main.tf | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index 7f2bb0ebc..a94bff67b 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -1,4 +1,4 @@ - + netcoreapp8.0 @@ -8,11 +8,11 @@ - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index ac2eea487..8b3f6f214 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -159,7 +159,7 @@ resource "null_resource" "main_service_setup" { export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" - export AWS_REGION="$${AWS_REGION}" + export AWS_REGION="${var.aws_region}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From 58a17d5249c508e50b9047a7c3b1f8d47943e09d Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 09:01:26 -0800 Subject: [PATCH 15/45] dotnet-ec2-default test 13 --- terraform/dotnet/ec2/default/main.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 8b3f6f214..36a0fbff2 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,8 +154,13 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces + export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf + export OTEL_EXPORTER_OTLP_METRICS_INSECURE=true + export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeter export SERVICE_NAME='dotnet-sample-application-${var.test_id}' export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" From c99a0f3c22754f532d8524cbe49bca85376d1764 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 09:40:46 -0800 Subject: [PATCH 16/45] reverting back to passing emf test code --- .../Controllers/AppController.cs | 4 ---- .../dotnet/asp_frontend_service/Startup.cs | 19 ------------------- .../asp_frontend_service.csproj | 6 +----- terraform/dotnet/ec2/default/main.tf | 18 ++++-------------- 4 files changed, 5 insertions(+), 42 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index a77cc768a..0023bfd93 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -11,10 +11,6 @@ using Amazon.S3.Model; using System.Diagnostics.Metrics; using System.Collections.Generic; -using OpenTelemetry; -using OpenTelemetry.Metrics; -using OpenTelemetry.Resources; -using OpenTelemetry.Exporter; namespace asp_frontend_service.Controllers; diff --git a/sample-apps/dotnet/asp_frontend_service/Startup.cs b/sample-apps/dotnet/asp_frontend_service/Startup.cs index 8bea30b91..657099447 100644 --- a/sample-apps/dotnet/asp_frontend_service/Startup.cs +++ b/sample-apps/dotnet/asp_frontend_service/Startup.cs @@ -7,9 +7,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using OpenTelemetry.Metrics; -using OpenTelemetry.Resources; -using System.Collections.Generic; namespace asp_frontend_service; @@ -28,22 +25,6 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); - - // Configure OpenTelemetry for custom pipeline metrics - services.AddOpenTelemetry() - .ConfigureResource(resource => resource - .AddService(Environment.GetEnvironmentVariable("SERVICE_NAME") ?? "dotnet-sample-application") - .AddAttributes(new Dictionary { { "Telemetry.Source", "UserMetric" } })) - .WithMetrics(metrics => metrics - .AddAspNetCoreInstrumentation() - .AddMeter("myMeter") - .AddOtlpExporter(options => { - options.Endpoint = new Uri(Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") ?? "http://localhost:4318/v1/metrics"); - }) - .AddConsoleExporter((exporterOptions, metricReaderOptions) => - { - metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000; - })); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index a94bff67b..c99187c1f 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -8,12 +8,8 @@ - - - - - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 36a0fbff2..08384dfba 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -151,20 +151,10 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/metrics - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics - export OTEL_METRICS_EXPORTER=otlp - export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces - export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics - export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_METRICS_INSECURE=true - export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeter - export SERVICE_NAME='dotnet-sample-application-${var.test_id}' - export DEPLOYMENT_ENVIRONMENT_NAME='ec2:default' - export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" - export AWS_REGION="${var.aws_region}" + export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics + export OTEL_METRICS_EXPORTER=none + export OTEL_RESOURCE_ATTRIBUTES=service.name=dotnet-sample-application-${var.test_id} export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From e454e64340f34ad3e12449526f35726536c2f902 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 14:57:34 -0800 Subject: [PATCH 17/45] Testing environment variables --- terraform/dotnet/ec2/default/main.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 08384dfba..a76f8711c 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -153,8 +153,9 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics - export OTEL_METRICS_EXPORTER=none - export OTEL_RESOURCE_ATTRIBUTES=service.name=dotnet-sample-application-${var.test_id} + export OTEL_METRICS_EXPORTER=otlp + export SERVICE_NAME='service.name=dotnet-sample-application-${var.test_id}' + export OTEL_RESOURCE_ATTRIBUTES="$${{SERVICE_NAME}"} export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From 5aeb11bec6cff88a94ccf4b8a44c65734baab42b Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 12 Nov 2025 15:08:22 -0800 Subject: [PATCH 18/45] Testing environment variables --- terraform/dotnet/ec2/default/main.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index a76f8711c..b7cf7892a 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -153,9 +153,10 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics - export OTEL_METRICS_EXPORTER=otlp + export OTEL_METRICS_EXPORTER=none export SERVICE_NAME='service.name=dotnet-sample-application-${var.test_id}' - export OTEL_RESOURCE_ATTRIBUTES="$${{SERVICE_NAME}"} + export DEPLOYMENT_ENVIRONMENT_NAME="$${DEPLOYMENT_ENVIRONMENT_NAME}" + export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From dc8880366be95a8f29829e031f735e778df05831 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Thu, 13 Nov 2025 10:57:10 -0800 Subject: [PATCH 19/45] dotnet-ec2-default test 13 --- .../Controllers/AppController.cs | 17 ++++++++++------- .../asp_frontend_service.csproj | 2 +- terraform/dotnet/ec2/default/main.tf | 7 ++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index 0023bfd93..c8bb38d3c 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -11,7 +11,10 @@ using Amazon.S3.Model; using System.Diagnostics.Metrics; using System.Collections.Generic; - +using OpenTelemetry; +using OpenTelemetry.Metrics; +using OpenTelemetry.Resources; +using OpenTelemetry.Exporter; namespace asp_frontend_service.Controllers; @@ -25,17 +28,17 @@ public class AppController : ControllerBase private static bool threadStarted = false; private readonly AmazonS3Client s3Client = new AmazonS3Client(); private readonly HttpClient httpClient = new HttpClient(); - private static readonly Meter meter = new Meter("myMeter"); + private static readonly Meter meter = new Meter("myMeterSource"); private static readonly Counter agentBasedCounter = meter.CreateCounter("agent_based_counter"); private static readonly Histogram agentBasedHistogram = meter.CreateHistogram("agent_based_histogram"); private static readonly UpDownCounter agentBasedGauge = meter.CreateUpDownCounter("agent_based_gauge"); // Custom pipeline metrics - only create if specific env vars exist - private static readonly Meter? pipelineMeter; - private static readonly Counter? customPipelineCounter; - private static readonly Histogram? customPipelineHistogram; - private static readonly UpDownCounter? customPipelineGauge; - private static readonly MeterProvider? pipelineMeterProvider; + private static readonly Meter pipelineMeter; + private static readonly Counter customPipelineCounter; + private static readonly Histogram customPipelineHistogram; + private static readonly UpDownCounter customPipelineGauge; + private static readonly MeterProvider pipelineMeterProvider; static AppController() { diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index c99187c1f..4fec3c201 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -8,8 +8,8 @@ + - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index b7cf7892a..919734df2 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -152,11 +152,8 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics - export OTEL_METRICS_EXPORTER=none - export SERVICE_NAME='service.name=dotnet-sample-application-${var.test_id}' - export DEPLOYMENT_ENVIRONMENT_NAME="$${DEPLOYMENT_ENVIRONMENT_NAME}" - export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment.name=$${DEPLOYMENT_ENVIRONMENT_NAME}" + export OTEL_METRICS_EXPORTER=otlp + export OTEL_RESOURCE_ATTRIBUTES="service.name=dotnet-sample-application-${var.test_id},deployment.environment.name=ec2:default" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From d127955d8c4b8b7b3f05d9684e8764be4ad4d0f3 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Tue, 18 Nov 2025 16:06:45 -0800 Subject: [PATCH 20/45] testing env. variables --- .../Controllers/AppController.cs | 35 ++++++++++--------- .../asp_frontend_service.csproj | 3 ++ terraform/dotnet/ec2/default/main.tf | 10 ++++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index c8bb38d3c..e30bcd9e3 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -29,10 +29,10 @@ public class AppController : ControllerBase private readonly AmazonS3Client s3Client = new AmazonS3Client(); private readonly HttpClient httpClient = new HttpClient(); private static readonly Meter meter = new Meter("myMeterSource"); - private static readonly Counter agentBasedCounter = meter.CreateCounter("agent_based_counter"); - private static readonly Histogram agentBasedHistogram = meter.CreateHistogram("agent_based_histogram"); - private static readonly UpDownCounter agentBasedGauge = meter.CreateUpDownCounter("agent_based_gauge"); - + private static readonly Counter agentBasedCounter; + private static readonly Histogram agentBasedHistogram; + private static readonly UpDownCounter agentBasedGauge; + // Custom pipeline metrics - only create if specific env vars exist private static readonly Meter pipelineMeter; private static readonly Counter customPipelineCounter; @@ -42,18 +42,16 @@ public class AppController : ControllerBase static AppController() { + + agentBasedCounter = meter.CreateCounter("agent_based_counter"); + agentBasedHistogram = meter.CreateHistogram("agent_based_histogram"); + agentBasedGauge = meter.CreateUpDownCounter("agent_based_gauge"); + var serviceName = Environment.GetEnvironmentVariable("SERVICE_NAME"); var deploymentEnv = Environment.GetEnvironmentVariable("DEPLOYMENT_ENVIRONMENT_NAME"); if (!string.IsNullOrEmpty(serviceName) && !string.IsNullOrEmpty(deploymentEnv)) { - var pipelineResource = ResourceBuilder.CreateDefault() - .AddAttributes(new Dictionary - { - ["service.name"] = serviceName, - ["deployment.environment.name"] = deploymentEnv - }) - .Build(); pipelineMeterProvider = Sdk.CreateMeterProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddAttributes(new Dictionary @@ -65,7 +63,13 @@ static AppController() { options.Endpoint = new Uri("http://localhost:4318/v1/metrics"); options.Protocol = OtlpExportProtocol.HttpProtobuf; + options.ExportProcessorType = ExportProcessorType.Batch; }) + .AddReader(new PeriodicExportingMetricReader(new OtlpMetricExporter(new OtlpExporterOptions + { + Endpoint = new Uri("http://localhost:4318/v1/metrics"), + Protocol = OtlpExportProtocol.HttpProtobuf + }), 1000)) .AddMeter("myMeter") .Build(); @@ -124,14 +128,11 @@ public string AWSSDKCall([FromQuery] string testingId) var random = new Random(); // Agent-based metrics - var histogramValue = random.NextDouble() * 100; - var gaugeValue = random.Next(-10, 11); - agentBasedCounter.Add(1, new KeyValuePair("Operation", "counter")); - agentBasedHistogram.Record(histogramValue, new KeyValuePair("Operation", "histogram")); - agentBasedGauge.Add(gaugeValue, new KeyValuePair("Operation", "gauge")); + agentBasedHistogram.Record(random.NextDouble() * 100, new KeyValuePair("Operation", "histogram")); + agentBasedGauge.Add(random.Next(-10, 11), new KeyValuePair("Operation", "gauge")); - // Custom pipeline metrics - only record if pipeline exists + // Pipeline metrics if (customPipelineCounter != null) { customPipelineCounter.Add(1, new KeyValuePair("Operation", "pipeline_counter")); diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index 4fec3c201..e709e4651 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -9,6 +9,9 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 919734df2..6b5c75039 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -151,9 +151,13 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 - export OTEL_METRICS_EXPORTER=otlp - export OTEL_RESOURCE_ATTRIBUTES="service.name=dotnet-sample-application-${var.test_id},deployment.environment.name=ec2:default" + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316 + export OTEL_METRICS_EXPORTER=console,otlp + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics + export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource + export SERVICE_NAME="dotnet-sample-application-${var.test_id}" + export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" + export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment=$${DEPLOYMENT_ENVIRONMENT_NAME}" export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on From d1349d8a3e1713fdc3931791d2294097cb0eb8b4 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 19 Nov 2025 08:39:42 -0800 Subject: [PATCH 21/45] testing env variables --- terraform/dotnet/ec2/default/main.tf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 6b5c75039..8d93d38f3 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -151,8 +151,10 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316 - export OTEL_METRICS_EXPORTER=console,otlp + export OTEL_TRACES_EXPORTER=otlp + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces + export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" From 02fcc6ef8814bcc16d33d9dd8815747cc0372d0c Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 19 Nov 2025 09:36:55 -0800 Subject: [PATCH 22/45] enabling ec2 instance connect for easier debugging --- terraform/dotnet/ec2/default/main.tf | 4 ++++ .../dotnet/ec2/default/aws-sdk-call-log.mustache | 4 ++-- .../dotnet/ec2/default/outgoing-http-call-log.mustache | 4 ++-- .../dotnet/ec2/default/remote-service-log.mustache | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 8d93d38f3..c445ab3d7 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -119,6 +119,9 @@ resource "null_resource" "main_service_setup" { sudo dnf install -y dotnet-sdk-${var.language_version} sudo yum install unzip -y + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + # Copy in CW Agent configuration agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}' echo $agent_config > amazon-cloudwatch-agent.json @@ -163,6 +166,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on + export AWS_REGION="${var.aws_region}" export ASPNETCORE_URLS=http://0.0.0.0:8080 nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_frontend_service.dll & diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache index 765527c87..06f8fadda 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET aws-sdk-call", + "Operation": "GET /aws-sdk-call", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET aws-sdk-call", + "Operation": "GET /aws-sdk-call", "Version": "^1$", "RemoteService": "AWS::S3", "RemoteOperation": "GetBucketLocation", diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache index 237ad1e7d..848e84902 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET outgoing-http-call", + "Operation": "GET /outgoing-http-call", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET outgoing-http-call", + "Operation": "GET /outgoing-http-call", "Version": "^1$", "RemoteService": "aws.amazon.com:443", "RemoteOperation": "GET /", diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache index 603ef48a1..cd457dc7b 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET remote-service", + "Operation": "GET /remote-service", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET remote-service", + "Operation": "GET /remote-service", "Version": "^1$", "RemoteService": "{{remoteServiceDeploymentName}}", "RemoteOperation": "GET /healthcheck", From 9188387b38e2ad0e85e7a07610e19d31e30b54a3 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 11:11:29 -0800 Subject: [PATCH 23/45] updating aws.distro version --- .../dotnet/asp_frontend_service/asp_frontend_service.csproj | 2 +- .../dotnet/ec2/default/aws-sdk-call-log.mustache | 4 ++-- .../dotnet/ec2/default/outgoing-http-call-log.mustache | 4 ++-- .../dotnet/ec2/default/remote-service-log.mustache | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index e709e4651..a2ee9c879 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -8,7 +8,7 @@ - + diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache index 06f8fadda..765527c87 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-sdk-call-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /aws-sdk-call", + "Operation": "GET aws-sdk-call", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /aws-sdk-call", + "Operation": "GET aws-sdk-call", "Version": "^1$", "RemoteService": "AWS::S3", "RemoteOperation": "GetBucketLocation", diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache index 848e84902..237ad1e7d 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/outgoing-http-call-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /outgoing-http-call", + "Operation": "GET outgoing-http-call", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /outgoing-http-call", + "Operation": "GET outgoing-http-call", "Version": "^1$", "RemoteService": "aws.amazon.com:443", "RemoteOperation": "GET /", diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache index cd457dc7b..603ef48a1 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/remote-service-log.mustache @@ -2,7 +2,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /remote-service", + "Operation": "GET remote-service", "Version": "^1$", "Telemetry.Source": "^LocalRootSpan$", "Host": "^ip(-[0-9]{1,3}){4}.*$" @@ -11,7 +11,7 @@ "EC2.InstanceId": "^{{instanceId}}$", "Environment": "^ec2:default$", "PlatformType": "^AWS::EC2$", - "Operation": "GET /remote-service", + "Operation": "GET remote-service", "Version": "^1$", "RemoteService": "{{remoteServiceDeploymentName}}", "RemoteOperation": "GET /healthcheck", From f5eb83a2d74d28799ea3b5797d015796747c5e94 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 11:38:19 -0800 Subject: [PATCH 24/45] testing metric dimension change --- .../asp_frontend_service/Controllers/AppController.cs | 3 +-- .../dotnet/ec2/default/aws-otel-custom-metrics.mustache | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index e30bcd9e3..9c9368ad4 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -56,8 +56,7 @@ static AppController() pipelineMeterProvider = Sdk.CreateMeterProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddAttributes(new Dictionary { - ["service.name"] = serviceName, - ["deployment.environment.name"] = deploymentEnv + ["service.name"] = serviceName })) .AddOtlpExporter(options => { diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache index f0335f8e1..c56e02757 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache @@ -164,7 +164,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: service.name @@ -186,7 +186,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: service.name @@ -208,7 +208,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: service.name From c30d78c8f7461b77500a7304eacb87ae6cae71ae Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 12:33:29 -0800 Subject: [PATCH 25/45] Updating metric dimensions --- .../Controllers/AppController.cs | 5 +++-- .../ec2/default/aws-otel-custom-metrics.mustache | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index 9c9368ad4..265d4fdb3 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -54,9 +54,10 @@ static AppController() { pipelineMeterProvider = Sdk.CreateMeterProviderBuilder() - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddAttributes(new Dictionary + .SetResourceBuilder(ResourceBuilder.CreateEmpty().AddAttributes(new Dictionary { - ["service.name"] = serviceName + ["service.name"] = serviceName, + ["deployment.environment.name"] = deploymentEnv })) .AddOtlpExporter(options => { diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache index c56e02757..94a19a742 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache @@ -6,7 +6,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: aws.local.service @@ -58,7 +58,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: aws.local.service @@ -110,7 +110,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment.name + name: deployment.environment value: ec2:default - name: aws.local.service @@ -164,7 +164,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment + name: deployment.environment.name value: ec2:default - name: service.name @@ -186,7 +186,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment + name: deployment.environment.name value: ec2:default - name: service.name @@ -208,7 +208,7 @@ namespace: {{metricNamespace}} dimensions: - - name: deployment.environment + name: deployment.environment.name value: ec2:default - name: service.name From e86368ddd6188ab8f9e9429c31af4a457acea239 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 12:48:25 -0800 Subject: [PATCH 26/45] updating metric dimensions --- .../default/aws-otel-custom-metrics.mustache | 98 +++++++++++++------ 1 file changed, 67 insertions(+), 31 deletions(-) diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache index 94a19a742..1504e0f7f 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache @@ -48,7 +48,28 @@ name: host.id value: ANY_VALUE - - name: telemetry.auto.version + name: telemetry.distro.version + value: ANY_VALUE + - + name: telemetry.distro.name + value: ANY_VALUE + - + name: process.runtime.version + value: ANY_VALUE + - + name: process.pid + value: ANY_VALUE + - + name: container.id + value: ANY_VALUE + - + name: process.owner + value: ANY_VALUE + - + name: process.runtime.name + value: ANY_VALUE + - + name: process.runtime.description value: ANY_VALUE - name: cloud.platform @@ -100,7 +121,28 @@ name: host.id value: ANY_VALUE - - name: telemetry.auto.version + name: telemetry.distro.version + value: ANY_VALUE + - + name: telemetry.distro.name + value: ANY_VALUE + - + name: process.runtime.version + value: ANY_VALUE + - + name: process.pid + value: ANY_VALUE + - + name: container.id + value: ANY_VALUE + - + name: process.owner + value: ANY_VALUE + - + name: process.runtime.name + value: ANY_VALUE + - + name: process.runtime.description value: ANY_VALUE - name: cloud.platform @@ -152,7 +194,28 @@ name: host.id value: ANY_VALUE - - name: telemetry.auto.version + name: telemetry.distro.version + value: ANY_VALUE + - + name: telemetry.distro.name + value: ANY_VALUE + - + name: process.runtime.version + value: ANY_VALUE + - + name: process.pid + value: ANY_VALUE + - + name: container.id + value: ANY_VALUE + - + name: process.owner + value: ANY_VALUE + - + name: process.runtime.name + value: ANY_VALUE + - + name: process.runtime.description value: ANY_VALUE - name: cloud.platform @@ -172,15 +235,6 @@ - name: Operation value: pipeline_counter - - - name: telemetry.sdk.name - value: opentelemetry - - - name: telemetry.sdk.language - value: dotnet - - - name: telemetry.sdk.version - value: ANY_VALUE - metricName: custom_pipeline_histogram namespace: {{metricNamespace}} @@ -194,15 +248,6 @@ - name: Operation value: pipeline_histogram - - - name: telemetry.sdk.name - value: opentelemetry - - - name: telemetry.sdk.language - value: dotnet - - - name: telemetry.sdk.version - value: ANY_VALUE - metricName: custom_pipeline_gauge namespace: {{metricNamespace}} @@ -215,13 +260,4 @@ value: {{serviceName}} - name: Operation - value: pipeline_gauge - - - name: telemetry.sdk.name - value: opentelemetry - - - name: telemetry.sdk.language - value: dotnet - - - name: telemetry.sdk.version - value: ANY_VALUE \ No newline at end of file + value: pipeline_gauge \ No newline at end of file From 70a63a04fd4130f9c8856e8e1461cb21c5c748c8 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 13:22:49 -0800 Subject: [PATCH 27/45] updating validation templates --- .../dotnet/ec2/default/aws-otel-custom-metrics.mustache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache index 1504e0f7f..2c90fce2e 100644 --- a/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/default/aws-otel-custom-metrics.mustache @@ -1,6 +1,7 @@ # OpenTelemetry Custom Metrics Validation Templates - AWS SDK Call Only # ANY_VALUE defines a string to = 'ANY_VALUE' to pass validation testing # Custom export templates +# cloud.account.id is not being parsed correctly when using {{accountId}}, value has been replace with "ANY_VALUE". - metricName: agent_based_counter namespace: {{metricNamespace}} @@ -37,7 +38,7 @@ value: aws - name: cloud.account.id - value: {{accountId}} + value: ANY_VALUE - name: host.name value: ANY_VALUE @@ -110,7 +111,7 @@ value: aws - name: cloud.account.id - value: {{accountId}} + value: ANY_VALUE - name: host.name value: ANY_VALUE @@ -183,7 +184,7 @@ value: aws - name: cloud.account.id - value: {{accountId}} + value: ANY_VALUE - name: host.name value: ANY_VALUE From eb7d06f300fab98e7ec1f92a3597b0e82bf9b0cf Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 13:42:07 -0800 Subject: [PATCH 28/45] removing some env variables --- terraform/dotnet/ec2/default/main.tf | 2 -- 1 file changed, 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index c445ab3d7..18af07b46 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,9 +154,7 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_TRACES_EXPORTER=otlp export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource From 25c8fca80f76d5fbd5b5f14dd2a761d4675554e5 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 14:05:12 -0800 Subject: [PATCH 29/45] swapping env variables --- terraform/dotnet/ec2/default/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 18af07b46..7347baa3f 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,9 +154,9 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics + export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From 9f7982a571e947bbaa30c8065b27eb43eda72430 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 14:26:50 -0800 Subject: [PATCH 30/45] adding metrics endpoint back --- terraform/dotnet/ec2/default/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 7347baa3f..fcdfefa36 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -157,6 +157,7 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From 366fce2e399b6a65fc166d12cfe839a6e5cfb702 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 14:42:05 -0800 Subject: [PATCH 31/45] test --- terraform/dotnet/ec2/default/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index fcdfefa36..1f49094c1 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,8 +154,8 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/metrics + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource From 96c60841a00cfb018c790e755cf2d005e2b3c676 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 14:50:58 -0800 Subject: [PATCH 32/45] test 2 --- terraform/dotnet/ec2/default/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 1f49094c1..18af07b46 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,7 +154,6 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics From 83fcd9434e865122a147bc4b6e4fbb92cac1f9fd Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 14:59:13 -0800 Subject: [PATCH 33/45] test 3 --- terraform/dotnet/ec2/default/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 18af07b46..085b21d22 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,6 +154,7 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics From 4a8f851603e5b84dea5f4e799cd0b04a76a3b79c Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 15:19:54 -0800 Subject: [PATCH 34/45] test 4 --- terraform/dotnet/ec2/default/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 085b21d22..76932bce1 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,10 +154,10 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316 - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4316 + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From 1c09168ebb6d24f3cc8cf81ec118ed112440657c Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 15:46:15 -0800 Subject: [PATCH 35/45] test 5 --- terraform/dotnet/ec2/default/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 76932bce1..276cd9b34 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,7 +154,7 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4316 + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4316/v1/traces export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics From dd5aa9f6006413e85cf97304d17d160ea4181135 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 16:00:35 -0800 Subject: [PATCH 36/45] test 6 --- terraform/dotnet/ec2/default/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 276cd9b34..a502df3fa 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -157,6 +157,7 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4316/v1/traces export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp + export OTEL_TRACES_EXPORTER=otlp export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" From 0ee41d37ce114a1b45f678da6b1a2c3728c4a4ad Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 16:11:33 -0800 Subject: [PATCH 37/45] test 6 --- terraform/dotnet/ec2/default/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index a502df3fa..7cc532dc0 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -158,6 +158,8 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf + export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" From 92dc076ca3de0437af5af118ee3adb18c9c7dd60 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 3 Dec 2025 16:49:23 -0800 Subject: [PATCH 38/45] test 7 --- terraform/dotnet/ec2/default/main.tf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 7cc532dc0..caf8ba61e 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,13 +154,10 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4316/v1/traces + export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From c860d4bbc1885a70be7535002975e7e54919618b Mon Sep 17 00:00:00 2001 From: Vherremi Date: Thu, 4 Dec 2025 15:07:37 -0800 Subject: [PATCH 39/45] test 8 --- terraform/dotnet/ec2/default/main.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index caf8ba61e..6843aeda3 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -154,10 +154,11 @@ resource "null_resource" "main_service_setup" { export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4316 + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4318/v1/traces export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From 8bf20a5ffb3249b2f4653ac4bf26212dcb8b5a28 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Thu, 4 Dec 2025 16:34:14 -0800 Subject: [PATCH 40/45] test 9 --- terraform/dotnet/ec2/default/main.tf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 6843aeda3..2d7253aff 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -153,12 +153,13 @@ resource "null_resource" "main_service_setup" { export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll export OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro export OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" - export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4318/v1/traces - export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://127.0.0.1:4316/v1/metrics + export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://127.0.0.1:4318/v1/metrics + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces + export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf + export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics + export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" From 439660a1c3f34642ed8a694bea14d043f2b63c02 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Fri, 5 Dec 2025 09:17:07 -0800 Subject: [PATCH 41/45] test 10 --- terraform/dotnet/ec2/default/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 2d7253aff..fbb6fadbb 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -156,6 +156,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316 export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics From 0574b6cd1e6978032f0f68500b6bf7ced240ae2e Mon Sep 17 00:00:00 2001 From: Vherremi Date: Fri, 5 Dec 2025 09:31:36 -0800 Subject: [PATCH 42/45] test 11 --- terraform/dotnet/ec2/default/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index fbb6fadbb..0094117b4 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -156,7 +156,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316 + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics From 7acd1ee3b524136d1e4eb76a019a4c79439e5a4d Mon Sep 17 00:00:00 2001 From: Vherremi Date: Fri, 5 Dec 2025 09:50:41 -0800 Subject: [PATCH 43/45] test 12 --- terraform/dotnet/ec2/default/main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 0094117b4..24e6cf448 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -156,12 +156,14 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/traces export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource + export OTEL_DOTNET_AUTO_METER_ENABLED=true + export OTEL_DOTNET_AUTO_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment=$${DEPLOYMENT_ENVIRONMENT_NAME}" From ac42bc59b0456bf60b0e0d18554f03d7f542f616 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Fri, 5 Dec 2025 09:51:16 -0800 Subject: [PATCH 44/45] test 12 --- terraform/dotnet/ec2/default/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 24e6cf448..212028022 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -156,7 +156,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics export OTEL_METRICS_EXPORTER=otlp export OTEL_TRACES_EXPORTER=otlp - export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316/v1/traces + export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4316 export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics From 27bcf6dc766d3f5710ba0a7dbc4319bcf3353e75 Mon Sep 17 00:00:00 2001 From: Vherremi Date: Wed, 10 Dec 2025 13:53:31 -0800 Subject: [PATCH 45/45] test 13 --- .../asp_frontend_service/asp_frontend_service.csproj | 8 ++++---- terraform/dotnet/ec2/default/main.tf | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj index a2ee9c879..b236105b2 100644 --- a/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj +++ b/sample-apps/dotnet/asp_frontend_service/asp_frontend_service.csproj @@ -9,9 +9,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 212028022..fbb6fadbb 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -162,8 +162,6 @@ resource "null_resource" "main_service_setup" { export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES=myMeterSource - export OTEL_DOTNET_AUTO_METER_ENABLED=true - export OTEL_DOTNET_AUTO_METRICS_ENDPOINT=http://localhost:4318/v1/metrics export SERVICE_NAME="dotnet-sample-application-${var.test_id}" export DEPLOYMENT_ENVIRONMENT_NAME="ec2:default" export OTEL_RESOURCE_ATTRIBUTES="service.name=$${SERVICE_NAME},deployment.environment=$${DEPLOYMENT_ENVIRONMENT_NAME}"