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

[ISSUE #340]Integrate With OpenTelemetry for metrics in EventMesh #467

Merged
merged 21 commits into from
Aug 10, 2021
Merged

Conversation

Roc-00
Copy link
Contributor

@Roc-00 Roc-00 commented Jul 25, 2021

Fixes ISSUE#<340>.

Motivation

Export metrics data with open telemetry and use Prometheus for visual observation

Modifications

There is a readme document in the code I submitted. I use idea to run locally. I download Prometheus in the window version of the official website. The operation method of docker written in readme is given by reference to open telemetry. I haven't actually operated it. I was successful in running locally. I'm not sure whether the code I wrote meets the requirements, so I didn't finish all the metrics, but wrote three. If there is anything wrong, please put it forward and I will modify and improve it. When the code is perfect and correct, I will continue to write the rest of the code.

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? README.md

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2021

Codecov Report

Merging #467 (33cf1b7) into develop (4eaebde) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #467      +/-   ##
============================================
- Coverage       9.84%   9.80%   -0.04%     
  Complexity       283     283              
============================================
  Files            228     230       +2     
  Lines          10829   10870      +41     
  Branches         923     923              
============================================
  Hits            1066    1066              
- Misses          9666    9707      +41     
  Partials          97      97              
Impacted Files Coverage Δ
...ntmesh/runtime/metrics/http/HTTPMetricsServer.java 0.00% <0.00%> (ø)
...e/metrics/openTelemetry/OpenTelemetryExporter.java 0.00% <0.00%> (ø)
...nTelemetry/OpenTelemetryExporterConfiguration.java 0.00% <0.00%> (ø)

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 4eaebde...33cf1b7. Read the comment docs.


//maxHTTPCost
meter
.longValueObserverBuilder("max.HTTPCost")
Copy link
Member

Choose a reason for hiding this comment

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

It's strange to spell metric with hump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how should I spell?

Copy link
Member

Choose a reason for hiding this comment

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

eventmesh.http.request.elapsed.max

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get it

@tydhot
Copy link
Member

tydhot commented Jul 26, 2021

@qqeasonchen I found there is many metric in eventmesh now. Maybe it is a good opportunity to make them in otel.

Copy link
Member

@tydhot tydhot left a comment

Choose a reason for hiding this comment

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

good job, anyway. I think is it a good start for your open source journy。

@tydhot
Copy link
Member

tydhot commented Jul 26, 2021

btw, your document can be formatted with some tools.

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

Is it possible for us to use plugin implementation of exporter? I think maybe not everyone will use prometheus.

List open_telemetry = [
"io.opentelemetry:opentelemetry-api:1.3.0",
"io.opentelemetry:opentelemetry-sdk:1.3.0",
"io.opentelemetry:opentelemetry-sdk-metrics:1.3.0-alpha",
Copy link
Member

Choose a reason for hiding this comment

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

Can we use other stable version? Using alpha does not seem to be a good choice.

Copy link
Member

Choose a reason for hiding this comment

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

It is ok to use that. Otel's sdk metrics is in alpha although, it is widely used in https://github.com/open-telemetry/opentelemetry-java-instrumentation. This agent has been validated in enough prod environments.

Copy link
Member

Choose a reason for hiding this comment

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

OK


private HTTPServer server;//Prometheus server

int prometheusPort = 19090;//the endpoint to export metrics
Copy link
Member

Choose a reason for hiding this comment

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

It is better to add this to configuration properties.

Copy link
Member

Choose a reason for hiding this comment

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

agree

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've thought about it, but I'm not very good at it. What language is involved? script?

Copy link
Member

Choose a reason for hiding this comment

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

Most configuration is at eventmesh-runtime/conf/eventmesh.properties, in the future, I think it may be split into multiple files, but now you can just add the prometheusPort in this file, and load this config, you can see code in EventMeshHTTPConfiguration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will have a try.

@Roc-00
Copy link
Contributor Author

Roc-00 commented Jul 26, 2021

btw, your document can be formatted with some tools.

what kind of tools? I have no experience, but I will try my best to do that.

@tydhot
Copy link
Member

tydhot commented Jul 27, 2021

@Roc-00 https://doocs.gitee.io/md/#/
you can try this

@qqeasonchen
Copy link
Contributor

@qqeasonchen I found there is many metric in eventmesh now. Maybe it is a good opportunity to make them in otel.

yep.

@qqeasonchen qqeasonchen changed the title [ISSUE #340]Integrate With OpenTelemetry [ISSUE #340]Integrate With OpenTelemetry for metrics in EventMesh Jul 27, 2021
@lrhkobe
Copy link
Contributor

lrhkobe commented Jul 27, 2021

@Roc-00 Maybe the metrics about tcp in 'EventMeshTcpMonitor.java' can also be processed in the same way.

@Roc-00
Copy link
Contributor Author

Roc-00 commented Jul 27, 2021

@Roc-00 https://doocs.gitee.io/md/#/
you can try this

Is this similar to typora

@Roc-00
Copy link
Contributor Author

Roc-00 commented Jul 27, 2021

@Roc-00 Maybe the metrics about tcp in 'EventMeshTcpMonitor.java' can also be processed in the same way.

I will find out the difference between HTTP and TCP,then complete TCP and HTTP metrics

@qqeasonchen
Copy link
Contributor

@Roc-00 please re-submit this pr to branch opentelemetry, and add a design doc first like https://github.com/apache/incubator-eventmesh/blob/develop/docs/en/features/eventmesh-stream-design.md.

@Roc-00
Copy link
Contributor Author

Roc-00 commented Aug 1, 2021

@Roc-00重请提交这个pr 到分支开放遥测,并首先添加一个设计文档,如https://github.com/apache/incubator-eventmesh/blob/develop/docs/en/features/eventmesh-stream-design .MD

OK.

Copy link
Contributor

@qqeasonchen qqeasonchen left a comment

Choose a reason for hiding this comment

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

@Roc-00重请提交这个pr 到分支开放遥测,并首先添加一个设计文档,如https://github.com/apache/incubator-eventmesh/blob/develop/docs/en/features/eventmesh-stream-design .MD

OK.

please avoid chinese here.

@@ -0,0 +1,41 @@
# Open Telemetry exporter
Copy link
Contributor

Choose a reason for hiding this comment

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

readme file should not exist in src

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I delete it,or put it in the design doc

@@ -0,0 +1,46 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

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

yml file should not exist in src

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I put it in conf like this
image

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 is ok.

@Roc-00
Copy link
Contributor Author

Roc-00 commented Aug 2, 2021

@Roc-00 please re-submit this pr to branch opentelemetry, and add a design doc first like https://github.com/apache/incubator-eventmesh/blob/develop/docs/en/features/eventmesh-stream-design.md.

Should I close this PR so that I can re-submit this pr to branch opentelemetry?

@xwm1992
Copy link
Contributor

xwm1992 commented Aug 2, 2021

@Roc-00 please re-submit this pr to branch opentelemetry, and add a design doc first like https://github.com/apache/incubator-eventmesh/blob/develop/docs/en/features/eventmesh-stream-design.md.

Should I close this PR so that I can re-submit this pr to branch opentelemetry?

you can edit this pr in this page, change the branch you want to merge

@Roc-00 Roc-00 changed the base branch from develop to opentelemetry August 2, 2021 11:03
@Roc-00
Copy link
Contributor Author

Roc-00 commented Aug 4, 2021

image
Is this the tcp metrics?what is the meaning of "s" and "t"?
image

@Roc-00
Copy link
Contributor Author

Roc-00 commented Aug 4, 2021

image
Why the class TcpSummaryMetrics was never used?

@Roc-00
Copy link
Contributor Author

Roc-00 commented Aug 5, 2021

I only found the following tcp metrics.Are there any more?
image

@Roc-00 Roc-00 changed the base branch from opentelemetry to develop August 10, 2021 09:45
@Roc-00 Roc-00 changed the base branch from develop to opentelemetry August 10, 2021 10:11
@qqeasonchen qqeasonchen merged commit f0d8b55 into apache:opentelemetry Aug 10, 2021
xwm1992 pushed a commit that referenced this pull request Aug 13, 2021
* [ISSUE #340]Integrate With OpenTelemetry for metrics in EventMesh (#467)

* The Chinese in the notes is translated into English.

* Translation improvement

* Translation improvement

* fix Chinese annotation on runtime module

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Improper modification

* Improper modification

* improve

* improve

* improve

* tcp metrics export

* improve

* improve

* merge from otel branch

* check lisence

Co-authored-by: ZePeng Chen <[email protected]>
@Roc-00 Roc-00 deleted the develop branch September 8, 2021 12:25
xwm1992 pushed a commit to xwm1992/EventMesh that referenced this pull request Dec 27, 2021
* [ISSUE apache#340]Integrate With OpenTelemetry for metrics in EventMesh (apache#467)

* The Chinese in the notes is translated into English.

* Translation improvement

* Translation improvement

* fix Chinese annotation on runtime module

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Improper modification

* Improper modification

* improve

* improve

* improve

* tcp metrics export

* improve

* improve

* merge from otel branch

* check lisence

Co-authored-by: ZePeng Chen <[email protected]>
xwm1992 pushed a commit that referenced this pull request Aug 4, 2022
* [ISSUE #340]Integrate With OpenTelemetry for metrics in EventMesh (#467)

* The Chinese in the notes is translated into English.

* Translation improvement

* Translation improvement

* fix Chinese annotation on runtime module

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Export metrics data with open telemetry and use Prometheus for visual observation

* Improper modification

* Improper modification

* improve

* improve

* improve

* tcp metrics export

* improve

* improve

* merge from otel branch

* check lisence

Co-authored-by: ZePeng Chen <[email protected]>
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.

None yet

7 participants