Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get config: cannot resolve the configuration: retrieved value (type=string) cannot be used as a Conf #2935

Open
nbalmaceda-koronet opened this issue Jan 14, 2025 · 0 comments

Comments

@nbalmaceda-koronet
Copy link

nbalmaceda-koronet commented Jan 14, 2025

Describe the bug
SSM Parameter Store option to include aws-otel-collector config file isn't working properly

Steps to reproduce
This is my task definition, when I try to run my application using this definition as a sidecar it doesn't work and fails

{
      "name": "aws-collector",
      "image": "amazon/aws-otel-collector:latest",
      "cpu": 128,
      "memory": 512,
      "portMappings": [],
      "essential": true,
      "command": [
          "--config=/etc/ecs/ecs-default-config.yaml"
      ],
      "environment": [],
      "secrets": [
          {
              "name": "AOT_CONFIG_CONTENT",
              "valueFrom": "arn:aws:ssm:<region>:<account-id>:parameter/test/otel-config-grafana"
          }
      ],
}

What did you expect to see?
I expected to see the configuration correctly set, but I just received below logs

January 14, 2025 at 18:43 (UTC-3:00) | 2025/01/14 21:43:40 found no extra config, skip it, err: open /opt/aws/aws-otel-collector/etc/extracfg.txt: no such file or directory | aws-collector

January 14, 2025 at 18:43 (UTC-3:00) | 2025/01/14 21:43:40 attn: users of the `datadog`, `logzio`, `sapm`, `signalfx` exporter components. please refer to https://github.com/aws-observability/aws-otel-collector/issues/2734 in regards to an upcoming ADOT Collector breaking change | aws-collector

January 14, 2025 at 18:43 (UTC-3:00) | Error: failed to get config: cannot resolve the configuration: retrieved value (type=string) cannot be used as a Conf | aws-collector

January 14, 2025 at 18:43 (UTC-3:00) | 2025/01/14 21:43:40 application run finished with error: failed to get config: cannot resolve the configuration: retrieved value (type=string) cannot be used as a Conf | aws-collector

January 14, 2025 at 18:43 (UTC-3:00) | 2025/01/14 21:43:40 ADOT Collector version: v0.42.0 | aws-collector

Environment
It's related to deployment of the ADOT Collector in ECS, my Collector file was automatically generated by Grafana Cloud (Alloy)

otelcol.receiver.otlp "default" {
	grpc { }
	http { }

	output {
		metrics = [otelcol.processor.resourcedetection.default.input]
		logs    = [otelcol.processor.resourcedetection.default.input]
		traces  = [otelcol.processor.resourcedetection.default.input]
	}
}

otelcol.processor.resourcedetection "default" {
	detectors = ["env", "system", "ecs"]

	system {
		hostname_sources = ["os"]
	}

	output {
		metrics = [otelcol.processor.transform.drop_unneeded_resource_attributes.input]
		logs    = [otelcol.processor.transform.drop_unneeded_resource_attributes.input]
		traces  = [otelcol.processor.transform.drop_unneeded_resource_attributes.input]
	}
}

otelcol.processor.transform "drop_unneeded_resource_attributes" {
	error_mode = "ignore"

	trace_statements {
		context    = "resource"
		statements = [
			"delete_key(attributes, \"k8s.pod.start_time\")",
			"delete_key(attributes, \"os.description\")",
			"delete_key(attributes, \"os.type\")",
			"delete_key(attributes, \"process.command_args\")",
			"delete_key(attributes, \"process.executable.path\")",
			"delete_key(attributes, \"process.pid\")",
			"delete_key(attributes, \"process.runtime.description\")",
			"delete_key(attributes, \"process.runtime.name\")",
			"delete_key(attributes, \"process.runtime.version\")",
		]
	}

	metric_statements {
		context    = "resource"
		statements = [
			"delete_key(attributes, \"k8s.pod.start_time\")",
			"delete_key(attributes, \"os.description\")",
			"delete_key(attributes, \"os.type\")",
			"delete_key(attributes, \"process.command_args\")",
			"delete_key(attributes, \"process.executable.path\")",
			"delete_key(attributes, \"process.pid\")",
			"delete_key(attributes, \"process.runtime.description\")",
			"delete_key(attributes, \"process.runtime.name\")",
			"delete_key(attributes, \"process.runtime.version\")",
		]
	}

	log_statements {
		context    = "resource"
		statements = [
			"delete_key(attributes, \"k8s.pod.start_time\")",
			"delete_key(attributes, \"os.description\")",
			"delete_key(attributes, \"os.type\")",
			"delete_key(attributes, \"process.command_args\")",
			"delete_key(attributes, \"process.executable.path\")",
			"delete_key(attributes, \"process.pid\")",
			"delete_key(attributes, \"process.runtime.description\")",
			"delete_key(attributes, \"process.runtime.name\")",
			"delete_key(attributes, \"process.runtime.version\")",
		]
	}

	output {
		metrics = [otelcol.processor.transform.add_resource_attributes_as_metric_attributes.input]
		logs    = [otelcol.processor.batch.default.input]
		traces  = [
			otelcol.processor.batch.default.input,
			otelcol.connector.host_info.default.input,
		]
	}
}

otelcol.connector.host_info "default" {
	host_identifiers = ["host.name"]

	output {
		metrics = [otelcol.processor.batch.default.input]
	}
}

otelcol.processor.transform "add_resource_attributes_as_metric_attributes" {
	error_mode = "ignore"

	metric_statements {
		context    = "datapoint"
		statements = [
			"set(attributes[\"deployment.environment\"], resource.attributes[\"deployment.environment\"])",
			"set(attributes[\"service.version\"], resource.attributes[\"service.version\"])",
		]
	}

	output {
		metrics = [otelcol.processor.batch.default.input]
	}
}

otelcol.processor.batch "default" {
	output {
		metrics = [otelcol.exporter.otlphttp.grafana_cloud.input]
		logs    = [otelcol.exporter.otlphttp.grafana_cloud.input]
		traces  = [otelcol.exporter.otlphttp.grafana_cloud.input]
	}
}

otelcol.exporter.otlphttp "grafana_cloud" {
	client {
		endpoint = "https://otlp-gateway-prod-us-east-2.grafana.net/otlp"
		auth     = otelcol.auth.basic.grafana_cloud.handler
	}
}

otelcol.auth.basic "grafana_cloud" {
	username = "secretUsername"
	password = "secretPassword"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant