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

ENV_VAR for where to send spans #172

Closed
naseemkullah opened this issue Jul 4, 2019 · 19 comments
Closed

ENV_VAR for where to send spans #172

naseemkullah opened this issue Jul 4, 2019 · 19 comments
Labels
area:sdk Related to the SDK needs discussion Need more information before all suitable labels can be applied
Milestone

Comments

@naseemkullah
Copy link
Member

naseemkullah commented Jul 4, 2019

Hello,
an env var for agent "host" would be nice

In JS/open-census for example, i need this in my code, but could there already be a default "TRACING_AGENT_HOST" ?...

const exporter = new JaegerTraceExporter({
  host: process.env.OT_COLLECTOR_HOST || 'localhost',
});

... if there was a default env var I would set it ` and I could just have in code:

const exporter = new JaegerTraceExporter();

because in k8s, if using the AGENT is running as a daemonset we need to do something like this for the workload:

env:
- name: OT_COLLECTOR_HOST
  valueFrom:
    fieldRef:
      fieldPath: status.hostIP

Thank you

@tedsuo tedsuo added the area:sdk Related to the SDK label Jul 11, 2019
@iredelmeier iredelmeier added the needs discussion Need more information before all suitable labels can be applied label Jul 30, 2019
@SergeyKanzhelev
Copy link
Member

Is the host similar to Resource API? Maybe dup with the #61

@SergeyKanzhelev
Copy link
Member

@bogdandrutu
Copy link
Member

No activity from the author, I will close this. Please re-open and answer the questions if you still need this feature.

@Oberon00
Copy link
Member

It's maybe a bit harsh to close this on Monday when the last question was on Friday.

@bogdandrutu
Copy link
Member

Sorry did not see when was asked, so only when the issue was posted. you are correct.

@bogdandrutu bogdandrutu reopened this Sep 30, 2019
@bogdandrutu bogdandrutu added this to the Alpha v0.3 milestone Sep 30, 2019
@naseemkullah
Copy link
Member Author

Everything is in original post if anything is unclear please let me know.

@SergeyKanzhelev
Copy link
Member

Can you please take a look if resource API is what you are looking for.

Is the host similar to Resource API? Maybe dup with the #61
In OpenCensus it's described here: https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/Resource.md#from-environment-variables

@naseemkullah
Copy link
Member Author

naseemkullah commented Sep 30, 2019

The agent host is where the agent runs to send spans to.

@naseemkullah
Copy link
Member Author

Not sure tbh can you define the agent host with the resource API?

@SergeyKanzhelev
Copy link
Member

@naseemkullah I got it. You mean this agent/collector: https://github.com/open-telemetry/opentelemetry-collector

There is a quite similar issue that calls for standardizing of a configuration: #142

@naseemkullah
Copy link
Member Author

naseemkullah commented Sep 30, 2019

@naseemkullah I got it. You mean this agent/collector: https://github.com/open-telemetry/opentelemetry-collector

Yes exactly, the agent in particular.

There is a quite similar issue that calls for standardizing of a configuration: #142

Should we merge the issues then?

something like OTEL_COLLECTOR_HOST could be a good variable.

Please see https://github.com/jaegertracing/jaeger-client-node#environment-variables for an example of what is desired (JAEGER_AGENT_HOST can also be configured directly in exporter config)

@naseemkullah
Copy link
Member Author

I think this can be as simple as telling our Jaeger exporter to look for JAEGER_HOST or JAEGER_AGENT_HOST or what have you env var, and then default to localhost if none is set.

A similar thing can be done for each exporter.

@naseemkullah
Copy link
Member Author

naseemkullah commented Dec 1, 2019

Maybe a generic OT_COLLECTOR variable that is understood by all exporters could be good, (alongside exporter specific env vars such as JAGER_AGENT_HOST if not using the opentelemetry collector).

From my understanding the collector can run as an agent/sidecar (so default value to localhost) or standalone service as per the recent kubecon talk by @SergeyKanzhelev and @mtwo

As a side note I am a little confused by the difference between Jaeger's approach to distinguish agent and collector (the use of both of these) vs opentelemtry's one or the other approach (either collector sidecar or collector service)... @yurishkuro could you kindly chime in here?

@naseemkullah naseemkullah changed the title ENVIRONMENT_VARIABLE for AGENT HOST ENV_VAR for where to send spans Dec 1, 2019
@yurishkuro
Copy link
Member

Jaeger agent allows SDKs to have minimal requirements, e.g. no RPC framework is needed to submit the spans to the agent, and SDKs don't need to have manual configuration across all applications, such as the address of the collectors (because agents are always available on localhost).

@jmacd
Copy link
Contributor

jmacd commented Dec 3, 2019

When using OTLP, it would be nice if there is a default across OTel client libraries that uses localhost and a standard port to support zero configuration by default. An environment variable to specify a remote OTLP endpoint would be nice when the destination is not local.

@naseemkullah
Copy link
Member Author

Jaeger agent allows SDKs to have minimal requirements, e.g. no RPC framework is needed to submit the spans to the agent, and SDKs don't need to have manual configuration across all applications, such as the address of the collectors (because agents are always available on localhost).

Actually there is a case where Jaeger agents are not available on localhost, in the case of kubernetes where the jaeger-agent is run as a daemonset (as opposed to sidecar), it must be set as follows in the app's pod spec:

env:
- name: JAEGER_AGENT_HOST
  valueFrom:
    fieldRef:
      fieldPath: status.hostIP

@naseemkullah
Copy link
Member Author

I guess every exporter should have some standard env var for a host to look for when it is not localhost. In the case of the opentelemetry collector it should be OTEL_COLLECTOR_HOST and for Jaeger exporter it should be JAEGER_AGENT_HOST

@naseemkullah
Copy link
Member Author

We've added JAEGER_AGENT_HOST as an env var for the Jaeger Exporter in JS as per open-telemetry/opentelemetry-js#924. It would be nice that other languages follow suit.

As for the otel collector, can we decide on an env var? OT_COLLECTOR_HOST or OTEL_COLLECTOR_HOST ?

@naseemkullah
Copy link
Member Author

This should be addressed via #572

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk Related to the SDK needs discussion Need more information before all suitable labels can be applied
Projects
None yet
Development

No branches or pull requests

9 participants