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 otel collector config #170

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

danielqsj
Copy link
Contributor

@danielqsj danielqsj commented Feb 6, 2025

What type of PR is this?

fix

What this PR does / why we need it (English/Chinese):

the config of otel collector is outofdate, so the otel collector will not running, then the trace and metrics can not be received correctly.

Which issue(s) this PR fixes: #169

@danielqsj danielqsj requested review from a team as code owners February 6, 2025 13:12
@CLAassistant
Copy link

CLAassistant commented Feb 6, 2025

CLA assistant check
All committers have signed the CLA.

@danielqsj
Copy link
Contributor Author

@GuangmingLuo PTAL

Copy link
Member

@CoderPoet CoderPoet left a comment

Choose a reason for hiding this comment

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

/LGTM

@GuangmingLuo GuangmingLuo merged commit a578e3c into cloudwego:main Feb 7, 2025
3 of 4 checks passed
@tis-ttc
Copy link

tis-ttc commented Feb 7, 2025

改完后可以了,感谢。

提一个另外的问题,假如kitex hertz 这些服务和 opentelemetry 不是在一台机器上,应该怎么配置和修改代码才能正确 work 呢,尝试config 改成这样

receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

http:
endpoint: 0.0.0.0:4318

docker 部署的时候,写成

otel-collector:
    image: otel/opentelemetry-collector-contrib-dev:latest
    command: [ "--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}" ]
    volumes:
      - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
    ports:
      - "1888:1888"   # pprof extension
      - "8888"   # Prometheus metrics exposed by the collector
      - "8889:8889"   # Prometheus exporter metrics
      - "13133:13133" # health_check extension
      - "4318:4318"
      - "55679" # zpages extension
    depends_on:
      - jaeger-all-in-one

ports:
- "4318:4318"

service 的 provider 写的如下:

p := provider.NewOpenTelemetryProvider(
		provider.WithServiceName(serviceName),
		provider.WithExportEndpoint("http://192.168.1.19:4318"),
		provider.WithInsecure(),
	)

provider.WithExportEndpoint("http://192.168.1.19:4318"),

如果可以麻烦指导下,感谢

@danielqsj
Copy link
Contributor Author

@tis-ttc 应该用4317端口,配置和代码都从4318 -> 4317,只要网络能通就能work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

opentelemetry example 执行时报rpc error
5 participants