Skip to content

fix: clarify and expand the default env vars the agent provides to the configs #142

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

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

obs-gh-mattcotter
Copy link
Collaborator

Description

Clarify and expand the default env vars the agent provides to the configs. This makes the vanilla collector endpoint available as well as exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by "Bearer ", and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since the value is suffixed with "/v2/otel"

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

os.Setenv("OBSERVE_TOKEN", "Bearer "+token)
os.Setenv("OBSERVE_COLLECTOR_URL", collector_url)
os.Setenv("OBSERVE_OTEL_ENDPOINT", otelEndpoint)
os.Setenv("OBSERVE_PROMETHEUS_ENDPOINT", promEndpoint)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this get used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nowhere yet, but I will use it for the prometheus remote write exporter as I'm doing the metrics conversion.

@@ -83,9 +83,9 @@ processors:

exporters:
otlphttp/observe:
endpoint: ${env:OBSERVE_ENDPOINT}
endpoint: ${env:OBSERVE_OTEL_ENDPOINT}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works today and is just a cleanup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! This works, but it couldn't be used for prometheus or other collection as it had the /v2/otel baked into it. I think in an ideal world, users would specify the token and collection endpoint as top level env vars or config, and never reference them explicitly anywhere else.

@obs-gh-mattcotter obs-gh-mattcotter merged commit e70ca9f into v2 Dec 17, 2024
8 checks passed
@obs-gh-mattcotter obs-gh-mattcotter deleted the mc/env-vars branch December 17, 2024 16:32
obs-gh-mattcotter added a commit that referenced this pull request Dec 17, 2024
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Dec 19, 2024
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Jan 6, 2025
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Jan 14, 2025
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Jan 27, 2025
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Feb 3, 2025
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Feb 5, 2025
…e configs (#142)

### Description

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
obs-gh-mattcotter added a commit that referenced this pull request Feb 5, 2025
…he configs (#142)

Clarify and expand the default env vars the agent provides to the
configs. This makes the vanilla collector endpoint available as well as
exposing the prometheus endpoint. It also renames OBSERVE_TOKEN to
OBSERVE_AUTHORIZATION_HEADER for clarity since the value is prefixed by
`"Bearer "`, and renames OBSERVE_ENDPOINT to OBSERVE_OTEL_ENDPOINT since
the value is suffixed with `"/v2/otel"`

- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
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

Successfully merging this pull request may close these issues.

2 participants