Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Exporter/Metrics/OcAgent: Optimization for already-sent metrics. #1637

Conversation

songy23
Copy link
Contributor

@songy23 songy23 commented Dec 11, 2018

As a follow-up of #1629.

For already-sent metrics, set name instead of metric descriptor and don't need to set bucket options.

Updates #1567.

@codecov-io
Copy link

codecov-io commented Dec 11, 2018

Codecov Report

Merging #1637 into master will increase coverage by 0.03%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1637      +/-   ##
============================================
+ Coverage     83.03%   83.07%   +0.03%     
- Complexity     1851     1853       +2     
============================================
  Files           265      265              
  Lines          8551     8553       +2     
  Branches        823      824       +1     
============================================
+ Hits           7100     7105       +5     
+ Misses         1185     1182       -3     
  Partials        266      266
Impacted Files Coverage Δ Complexity Δ
...us/exporter/metrics/ocagent/MetricsProtoUtils.java 85.82% <85.71%> (+0.22%) 27 <0> (+2) ⬆️
...census/implcore/trace/export/SpanExporterImpl.java 95.89% <0%> (+1.36%) 9% <0%> (ø) ⬇️
...e/ocagent/OcAgentTraceServiceConfigRpcHandler.java 79.31% <0%> (+3.44%) 12% <0%> (ø) ⬇️

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 3b2984e...88b8652. Read the comment docs.

@bogdandrutu
Copy link
Contributor

Let's make sure we are ok to have this optimization. In the previous PR I was suggesting to just optimize the conversion of Descriptor and BucketsOptions to proto.

@songy23
Copy link
Contributor Author

songy23 commented Dec 13, 2018

I see, though I think this is why we add the metric.name field in the proto:

// Defines a Metric which has one or more timeseries.
message Metric {
  // The descriptor of the Metric. This is an optimization for network wire
  // size, from data-model perspective a Metric contains always a
  // MetricDescriptor.
  oneof descriptor {
    // In case of a streaming RPC can be sent only the first time a metric is
    // reported to save network traffic.
    MetricDescriptor metric_descriptor = 1;

    // In case of a streaming RPC this can be sent for metrics that already
    // sent the MetricDescriptor once.
    string name = 2;
  }
...
}

@songy23
Copy link
Contributor Author

songy23 commented Mar 13, 2019

We haven't made a decision on census-instrumentation/opencensus-proto#152 yet. Closing this PR for now.

@songy23 songy23 closed this Mar 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants