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

Add config to docker image #1792

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

pavolloffay
Copy link
Member

Signed-off-by: Pavol Loffay [email protected]

Description: <Describe what has changed.

Add examples/otel-local-config.yaml into docker image to make it easier for users to get a default config.

@tigrannajaryan could you please have a look?

Link to tracking Issue:

Updates #886

Follow up PR should add config into other distributions and add comments into the config.

Testing: < Describe what testing was performed and which tests were added.>

Tested docker build locally.

Documentation: < Describe the documentation added.>

Once this is merged I will update Docker instructions https://opentelemetry.io/docs/collector/about/ to use

docker create --name otelcol-config otelcol
docker cp otelcol-config:/config.yaml . && docker rm otelcol-config
// Edit the config.yaml
docker run  -v "${PWD}/config.yaml":/config.yaml  otelcol --config /config.yaml

Signed-off-by: Pavol Loffay <[email protected]>
Makefile Outdated
@@ -189,6 +189,7 @@ delete-tag:

.PHONY: docker-otelcol
docker-otelcol:
cp examples/otel-local-config.yaml cmd/otelcol
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not nice but seems better than setting the docker context to the root of the project.

@codecov
Copy link

codecov bot commented Sep 16, 2020

Codecov Report

Merging #1792 into master will decrease coverage by 0.84%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1792      +/-   ##
==========================================
- Coverage   92.38%   91.53%   -0.85%     
==========================================
  Files         258      258              
  Lines       18201    15564    -2637     
==========================================
- Hits        16815    14247    -2568     
+ Misses        972      906      -66     
+ Partials      414      411       -3     
Impacted Files Coverage Δ
service/internal/templates.go 30.43% <0.00%> (-21.09%) ⬇️
consumer/pdatautil/pdatautil.go 73.68% <0.00%> (-7.80%) ⬇️
processor/cloningfanoutconnector.go 61.11% <0.00%> (-7.78%) ⬇️
exporter/kafkaexporter/otlp_marshaller.go 71.42% <0.00%> (-6.35%) ⬇️
...rnal/scraper/processesscraper/processes_scraper.go 80.00% <0.00%> (-5.72%) ⬇️
extension/pprofextension/pprofextension.go 57.14% <0.00%> (-5.36%) ⬇️
service/builder/extensions_builder.go 80.76% <0.00%> (-4.53%) ⬇️
...eceiver/internal/scraper/processscraper/factory.go 55.55% <0.00%> (-4.45%) ⬇️
exporter/kafkaexporter/jaeger_marshaller.go 85.71% <0.00%> (-4.29%) ⬇️
receiver/prometheusreceiver/internal/metadata.go 87.50% <0.00%> (-4.17%) ⬇️
... and 238 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95389af...2c50a4d. Read the comment docs.

@tigrannajaryan
Copy link
Member

@pavolloffay this merely places the example config file in the docker image so that it is available for the user as a starting point for their custom config file, right?

@tigrannajaryan tigrannajaryan self-assigned this Sep 17, 2020
@pavolloffay
Copy link
Member Author

Correct see the example commands in the first comment on how the config can be edited (first copy to host then edit). Or users can run it directly with log exporters for quick demo purposes.

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

LGTM. Will wait a bit before mering to see @owais has any comments.

@owais
Copy link
Contributor

owais commented Sep 18, 2020

Contrib docker image uses /etc/otel/config.yaml as the default path for config file. So running the following command works:

docker -v $PWD/local/:/etc/otel otelcontribcol

assuming there is a config file at ./local/config.yaml.

Can we make the following changes?

  1. Change docker entrypoint and command to:
ENTRYPOINT ["/otelcol"]
CMD ["--config", "/etc/otel/config.yaml"]
  1. Copy the default config file to /etc/otel/config.yaml in the image.

This would ship a default config with the collector while being consistent with the contrib image. We should probably have a default config file for contrib image as well once this is merged.

@owais
Copy link
Contributor

owais commented Sep 18, 2020

I'm not sure about shipping the example config as the default one. I think the default config should be more or less usable out of the box and needs to be vetted more carefully compared to an example config file. Also an example config might contains a lot of stuff than we want to enable by defaults. So probably a separate dedicated default config file would be better (even if it's a 1:1 copy of example config today).

@pavolloffay
Copy link
Member Author

@owais I have made the proposed changes to the dockerfile.

I think the default config should be more or less usable out of the box and needs to be vetted more carefully compared to an example config file. Also an example config might contains a lot of stuff than we want to enable by defaults. So probably a separate dedicated default config file would be better (even if it's a 1:1 copy of example config today).

The default and example configs should be both ready to run out of the box. At the moment I don't see any difference between between example and default config. Both should use sane components and document what is being used for users to understand how to change the config.

I have copied the example config to the otel dir for now.

Copy link
Contributor

@owais owais left a comment

Choose a reason for hiding this comment

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

LGTM but let's enable OTLP in the default config file.

pipelines:

traces:
receivers: [opencensus, jaeger, zipkin]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should enable OTLP by default. I think it should be the default or recommended receiver for all data types.

@pavolloffay
Copy link
Member Author

@owais I will submit a follow-up PR to enable OTLP in the example and default configs.

@bogdandrutu bogdandrutu merged commit cba929d into open-telemetry:master Sep 22, 2020
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
…jaeger (open-telemetry#1792)

* Bump google.golang.org/api in /exporters/trace/jaeger

Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.43.0 to 0.44.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/master/CHANGES.md)
- [Commits](googleapis/google-api-go-client@v0.43.0...v0.44.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <[email protected]>
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
…y#1792)

Bumps [boto3](https://github.com/boto/boto3) from 1.24.32 to 1.24.33.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](boto/boto3@1.24.32...1.24.33)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
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.

4 participants