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

Use DCP injected values for OTEL service id and name #67

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Oct 5, 2023

This PR makes the OTEL names consistent with DCP names. It fixes the problem of replicas, e.g. catalogservice, being duplicated. Now the OTEL name matches what is displayed on the projects page.

image

I'd like guidance on how this pattern will work when deployed to other environments. Do they ignore/overwrite the env vars set for service id and name and apply their own? Does this PR need to change to reflect that?

Once this approach is verified as good then port the changes to the template.

Note: this change relies on a preview build of DCP that isn't in the workload yet. The right version of DCP should be available in a few days.

@davidfowl
Copy link
Member

Fix the dapr impl as well

env["OTEL_EXPORTER_OTLP_ENDPOINT"] = this._configuration[DashboardOtlpUrlVariableName] ?? DashboardOtlpUrlDefaultValue;
env["OTEL_EXPORTER_OTLP_INSECURE"] = "true";
env["OTEL_EXPORTER_OTLP_PROTOCOL"] = "grpc";

@JamesNK
Copy link
Member Author

JamesNK commented Oct 5, 2023

Fix it in what way? The environment variables are automatically set on it. I ran the dapr samples and the expected env vars are present with good values:

image

I'm not sure why this code was added:

env["OTEL_EXPORTER_OTLP_ENDPOINT"] = this._configuration[DashboardOtlpUrlVariableName] ?? DashboardOtlpUrlDefaultValue;
env["OTEL_EXPORTER_OTLP_INSECURE"] = "true";
env["OTEL_EXPORTER_OTLP_PROTOCOL"] = "grpc";

The endpoint is already set, and OTLP is insecure and grpc by default.

@JamesNK
Copy link
Member Author

JamesNK commented Oct 5, 2023

Fix the dapr impl as well

Done:
image

Bonus: Centralized OTEL configuration between projects and dapr sidecar.

@JamesNK JamesNK enabled auto-merge (squash) October 5, 2023 04:11
@JamesNK JamesNK disabled auto-merge October 5, 2023 04:11
@JamesNK JamesNK force-pushed the jamesnk/envvar-novalue branch from 54070d2 to bfc4a3b Compare October 5, 2023 08:04
@JamesNK JamesNK force-pushed the jamesnk/envvar-novalue branch from bfc4a3b to ac5cdf1 Compare October 6, 2023 02:05
@JamesNK JamesNK enabled auto-merge (squash) October 6, 2023 02:25
@JamesNK JamesNK merged commit 33dba30 into main Oct 6, 2023
@JamesNK JamesNK deleted the jamesnk/envvar-novalue branch October 6, 2023 02:28
@davidfowl
Copy link
Member

Is this DCP version in VS?

@JamesNK JamesNK removed the NO MERGE label Oct 6, 2023
@JamesNK
Copy link
Member Author

JamesNK commented Oct 6, 2023

Worked when I tested it.

@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants