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 metrics. #44

Merged
merged 4 commits into from
Aug 25, 2022
Merged

Add metrics. #44

merged 4 commits into from
Aug 25, 2022

Conversation

jmjoy
Copy link
Member

@jmjoy jmjoy commented Aug 23, 2022

Add metrics support.

@jmjoy jmjoy added the enhancement New feature or request label Aug 23, 2022
@jmjoy jmjoy added this to the 0.4.0 milestone Aug 23, 2022
README.md Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2022

Codecov Report

Merging #44 (5e87a20) into master (4d786ff) will decrease coverage by 5.41%.
The diff coverage is 1.69%.

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   27.57%   22.16%   -5.42%     
==========================================
  Files          16       18       +2     
  Lines         475      591     +116     
==========================================
  Hits          131      131              
- Misses        344      460     +116     
Impacted Files Coverage Δ
src/common/system_time.rs 0.00% <ø> (ø)
src/logging/logger.rs 0.00% <0.00%> (ø)
src/logging/record.rs 0.00% <ø> (ø)
src/metrics/meter.rs 0.00% <0.00%> (ø)
src/metrics/metricer.rs 0.00% <0.00%> (ø)
src/reporter/grpc.rs 0.00% <0.00%> (ø)
src/reporter/mod.rs 0.00% <ø> (ø)
src/reporter/print.rs 36.84% <28.57%> (-9.83%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jmjoy jmjoy marked this pull request as ready for review August 23, 2022 12:16
@jmjoy jmjoy requested a review from wu-sheng August 23, 2022 12:16
README.md Outdated

### MeterRecord

MeterRecord is the simple builder for the MeterData, which is the metrics format of Skywalking.
Copy link
Member

Choose a reason for hiding this comment

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

You should provide a full list of the metric data types with explanations.

We have a short version on main repo docs, https://skywalking.apache.org/docs/main/latest/en/protocols/readme/#metrics which targets to proto file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@wu-sheng
Copy link
Member

From a metrics APIs pespective, to ease the usage, the single value metric is usually separated as counter or gauge to provide different use patterns.

You could refer Java meter APIs from here, https://skywalking.apache.org/docs/skywalking-java/latest/en/setup/service-agent/java-agent/java-plugin-development-guide/#meter-plugin

@jmjoy jmjoy marked this pull request as draft August 24, 2022 02:30
@jmjoy jmjoy marked this pull request as ready for review August 25, 2022 02:30
@jmjoy
Copy link
Member Author

jmjoy commented Aug 25, 2022

I have refer to java agent and update the API.

@jmjoy jmjoy requested a review from wu-sheng August 25, 2022 03:35
@wu-sheng
Copy link
Member

Just confirm, all metrics objects(counter, gauge, histogram), are they thread safe? Such as concurrency write, and write and report concurrently.

@jmjoy
Copy link
Member Author

jmjoy commented Aug 25, 2022

Just confirm, all metrics objects(counter, gauge, histogram), are they thread safe? Such as concurrency write, and write and report concurrently.

Yes, because they all implement Transform, which need Send and Sync, and the method increment of Counter, method add_value of Histogram, only need &self (the inner use atomic).

Copy link
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants