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

fix: changes default configs to work with docker-compose setup #45

Merged
merged 10 commits into from
Mar 5, 2021

Conversation

JBAhire
Copy link
Member

@JBAhire JBAhire commented Mar 4, 2021

Description

Testing

Tested with docker-compose setup locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@JBAhire JBAhire requested review from jcchavezs and pavolloffay March 4, 2021 06:30
kafka:
protocol_version: 2.0.0
brokers:
- kafka-zookeeper:9092

Choose a reason for hiding this comment

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

Should be good to have bootstrap:9092 and adding bootstrap as another alias in docker-compose?

protocol_version: 2.0.0
brokers:
- kafka-zookeeper:9092
topic: jaeger-spans

Choose a reason for hiding this comment

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

Looks very specific config as default, and if someone wants to use our collector out-of-box, would make it difficult?

Copy link

@kotharironak kotharironak Mar 4, 2021

Choose a reason for hiding this comment

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

Can config folders have more than one config file as part of an image? And docker-compose setup can use the one which requires for HT. So, that way, it can work in default as well as along with HT bypassing config argument.

So, I would suggest, let's have one more config file in repo along with default-config.yml, say default-ht-config.yml. And copy this config file as in docker image after line (https://github.com/hypertrace/hypertrace-collector/blob/main/Dockerfile#L18)

COPY default-ht-config.yml /etc/opt/hypertrace/default-ht-config.yml

And in docker-compose setup lets override only config argument as

CMD ["--config", "/etc/opt/hypertrace/default-ht-config.yml"]

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@jcchavezs jcchavezs Mar 4, 2021

Choose a reason for hiding this comment

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

I am not sure about the point you make @kotharironak. I feel like in most of the cases people will use the collector with hypertrace platform and in some cases people might try this collector because of the PII filter we are adding and in that case they need to touch the config. So I'd provide the default HT config and then let people pass other configs.

Choose a reason for hiding this comment

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

If, that is the case, should be fine. But, the default config will still be very specific to docker-compose setup

  • kafka-zookeeper (we still have to override with helm deployment). So, we can change it to bootstrap, and add one more alias in docker-compose.
  • jaeger-spans (this should be fine, and can be considered as our default entry point)

Copy link
Member Author

Choose a reason for hiding this comment

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

@kotharironak , this configs are not gonna affect helm in any way. there's separate configmap for helm.

Copy link
Contributor

Choose a reason for hiding this comment

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

kafka-zookeeper (we still have to override with helm deployment). So, we can change it to bootstrap, and add one more alias in docker-compose.

As per open-telemetry/opentelemetry-collector@047b0f3 we can use env var for that I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jcchavezs , I made ht-config as default while passing in command.

@jcchavezs
Copy link
Contributor

jcchavezs commented Mar 4, 2021 via email

@JBAhire
Copy link
Member Author

JBAhire commented Mar 4, 2021

@jcchavezs , @kotharironak, I added broker name as environment variable in ht-config file.

Dockerfile Outdated

EXPOSE 9411

ENTRYPOINT ["/usr/local/bin/hypertrace/collector"]
CMD ["--config", "/etc/opt/hypertrace/config.yml"]
CMD ["--config", "/etc/opt/hypertrace/ht-config.yml"]

Choose a reason for hiding this comment

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

I think you want to continue with,

CMD ["--config", "/etc/opt/hypertrace/config.yml"]

Copy link
Member Author

Choose a reason for hiding this comment

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

#45 (comment) I was going with @jcchavezs 's comment here.

Choose a reason for hiding this comment

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

Then, do we need one more config default-config.yml file? As we are going with ENV, let's just have one file then.

Copy link
Member Author

Choose a reason for hiding this comment

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

default-config.yml has prometheus and other things which we don't use in docker-compose so it basically exits at that point.

I will keep them separate and let people use default-configs and tweak them according to need

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree if we use env vars we don't need to have two separated files for default config.

Dockerfile Outdated

EXPOSE 9411

ENTRYPOINT ["/usr/local/bin/hypertrace/collector"]
CMD ["--config", "/etc/opt/hypertrace/config.yml"]
CMD ["--config", "/etc/opt/hypertrace/ht-config.yml"]

Choose a reason for hiding this comment

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

Suggested change
CMD ["--config", "/etc/opt/hypertrace/ht-config.yml"]
CMD ["--config", "/etc/opt/hypertrace/config.yml"]

kafka:
protocol_version: 2.0.0
brokers:
- ${BROKER}:9092

Choose a reason for hiding this comment

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

Is there a way to keep the default value?

${KAFKA_BROKERS:-kafka-zookeeper}

If, so, add even for topic as well
topic: ${KAFKA_TOPIC:-jaeger-spans}

And also take the entire string - ${BROKER:-bootstrap:9092}

Copy link
Member Author

@JBAhire JBAhire Mar 4, 2021

Choose a reason for hiding this comment

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

It doesn't work with assigning default values. sample config here suggests the same.

So, we need to stick to using static environment variables, I am guessing.

hypertrace-collector    | 2021/03/04 13:05:21 application run finished with error: cannot setup pipelines: cannot build builtExporters: error creating kafka exporter: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I was thinking the same. I will work this out open-telemetry/opentelemetry-collector#2534.

default-config.yml Outdated Show resolved Hide resolved
default-config.yml Outdated Show resolved Hide resolved
JBAhire and others added 2 commits March 5, 2021 08:45
Co-authored-by: José Carlos Chávez <jcchavezs@gmail.com>
Co-authored-by: José Carlos Chávez <jcchavezs@gmail.com>
@jcchavezs
Copy link
Contributor

Thanks @JBAhire !

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.

3 participants