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

the configuration file path is all over the place #31403

Closed
dhrp opened this issue Feb 24, 2024 · 7 comments
Closed

the configuration file path is all over the place #31403

dhrp opened this issue Feb 24, 2024 · 7 comments
Labels
bug Something isn't working cmd/opampsupervisor documentation Improvements or additions to documentation exporter/googlecloud Stale

Comments

@dhrp
Copy link
Contributor

dhrp commented Feb 24, 2024

Component(s)

cmd/opampsupervisor, cmd/otelcontribcol, exporter/googlecloud (amongst others)

What happened?

Description

The problem is that it seems that there are several "standard" locations to put the config file. I have seen:

/etc/otel/config.yaml
/etc/otelcol/config.yaml
/etc/otelcol-contrib/config.yaml

And there are several Docker Image releases that read it, by default, from different places. - As a result getting started with OpenTelemetry is harder than it needs to be. I wasted time following this example on the googelcloudexporter, only to later find out the config path in the example is wrong.

docker run
--volume ~/service-account-key.json:/etc/otel/key.json
--volume $(pwd)/config.yaml:/etc/otel/config.yaml
--env GOOGLE_APPLICATION_CREDENTIALS=/etc/otel/key.json
--expose 4317
--expose 55681
--rm
otel/opentelemetry-collector-contrib

I'll make a PR to fix this instance on googelcloudexporter but I see it is happening on a lot of places: Amongst others: (search in the repo for "/etc/ote"

https://github.com/dhrp/opentelemetry-collector-contrib/blob/main/cmd/opampsupervisor/specification/README.md#L137
https://github.com/dhrp/opentelemetry-collector-contrib/blob/main/cmd/otelcontribcol/Dockerfile#L15
https://github.com/dhrp/opentelemetry-collector-contrib/blob/3652b444802fad4819b50fbda41e0957000d8279/examples/couchbase/docker-compose.yaml#L16
https://github.com/dhrp/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/README.md#L60

What I propose is picking one location, and unifying all Dockerfiles, documentation and stuff to use that path by default. I know it's probably not easy to do, as it "may" break things, depending on how it's done, but it'll save lots of time in the future.

Steps to Reproduce

Follow the instructions on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/README.md, add the provided config file onto the suggested path.

Expected Result

Logs flowign to Google Cloud

Actual Result

Some debug logs coming out of the container, but nothing showing up on google. - No errors. -> Didn't realize config was never used!

Collector version

v0.95.0

Environment information

Environment

All

OpenTelemetry Collector configuration

-

Log output

No response

Additional context

No response

@dhrp dhrp added bug Something isn't working needs triage New item requiring triage labels Feb 24, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@andrzej-stencel
Copy link
Member

I agree it would be easier if there was a standard configuration path used by Otelcol Docker images, at the very least by the Otelcol core and contrib.

It would also help if the Overview for Otel core and contrib in Docker Hub was not empty, but instead described how to use the images with your own configuration.

image

@crobert-1 crobert-1 added the documentation Improvements or additions to documentation label Feb 28, 2024
@crobert-1
Copy link
Member

My main concern is how big of a breaking change this may be, but overall it's a good idea. It's confused me plenty of times, so I agree it would be nice to have one path. Feel free to submit a PR and the impact and path can be discussed there.

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Mar 1, 2024
@mx-psi
Copy link
Member

mx-psi commented Mar 2, 2024

Probably the minority opinion here, but I feel like having a default configuration in Dockerfiles is not very useful and if we were to change it my vote would be to remove the default configuration entirely

dmitryax pushed a commit that referenced this issue Mar 7, 2024
The google cloud exporter README suggests that the configfile is in
/etc/otel/config.yaml; but it's not.

(and I pulled my hair out for a while trying to figure out why my config
was not working).

**Description:**
I changed the path used for the config file in the example to reflect
the path used / set in the Dockerfile.

**Link to tracking Issue:**
#31403 

---------

Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
@andrzej-stencel
Copy link
Member

@crobert-1 has a good point that changing the paths would be a breaking change of big blast radius. I'd be fine with just documenting the paths used currently in the image registry (Docker Hub).

DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
…try#31404)

The google cloud exporter README suggests that the configfile is in
/etc/otel/config.yaml; but it's not.

(and I pulled my hair out for a while trying to figure out why my config
was not working).

**Description:**
I changed the path used for the config file in the example to reflect
the path used / set in the Dockerfile.

**Link to tracking Issue:**
open-telemetry#31403 

---------

Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
…try#31404)

The google cloud exporter README suggests that the configfile is in
/etc/otel/config.yaml; but it's not.

(and I pulled my hair out for a while trying to figure out why my config
was not working).

**Description:**
I changed the path used for the config file in the example to reflect
the path used / set in the Dockerfile.

**Link to tracking Issue:**
open-telemetry#31403 

---------

Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 13, 2024
@mx-psi
Copy link
Member

mx-psi commented May 13, 2024

This was recently brought up again on open-telemetry/opentelemetry-collector-releases/issues/530. I am going to close this and we can continue discussing on the other issue, since this pertains to opentelemetry-collector-releases

@mx-psi mx-psi closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/opampsupervisor documentation Improvements or additions to documentation exporter/googlecloud Stale
Projects
None yet
Development

No branches or pull requests

4 participants