Skip to content

Add export timestamps; distinguish Accumulation vs. Record #835

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

Merged
merged 11 commits into from
Jun 18, 2020

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Jun 17, 2020

This PR is factored out of a successor to #799.

In the export API:

  • Existing Record type becomes Accumulation, having the same fields.
  • Metadata struct is factored out, common part of both Record and Accumulation
  • New Accumulation type is Metadata + Aggregator, used for Accumulator->Integrator
  • New Record type is Metadata + Aggregation + timestamps, used for Integrator->Exporter

In the simple Integrator:

  • Add a StartCollection() method
  • Add an error to FinishCollection, used for checking the call sequence (and in the future to support errors from Merging aggregators)

In the OTLP code path:

  • Add timestamps to the tests. Currently the assumption is that all timestamps are delta oriented. In the follow-on change, SumObserver and UpDwnSumObserver will change their behavior.

@jmacd jmacd added the area:metrics Part of OpenTelemetry Metrics label Jun 17, 2020
@jmacd
Copy link
Contributor Author

jmacd commented Jun 17, 2020

For the record, the replacement branch for #799 contains the changes here plus the rest of #799:
https://github.com/jmacd/opentelemetry-go/tree/jmacd/799v2

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

This is a partial review, but I wanted to get some comments in now.
I think the overall strategy, but the Aggregator interface embedding the Aggregation interface seems troublesome. Otherwise, it looks good save for some variable renames (which I did not thoroughly exhaust).

@MrAlias MrAlias linked an issue Jun 17, 2020 that may be closed by this pull request
jmacd and others added 2 commits June 17, 2020 15:37
@jmacd
Copy link
Contributor Author

jmacd commented Jun 17, 2020

@MrAlias before you look again, I will check over the variable names of Accumulation variables that might be named like Records.

@jmacd
Copy link
Contributor Author

jmacd commented Jun 17, 2020

(I've audited all uses of "Accumulation" for variable name and comment correctness.)

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@jmacd jmacd merged commit 4e42717 into open-telemetry:master Jun 18, 2020
@jmacd jmacd deleted the jmacd/add_accum branch June 18, 2020 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add timestamp to collected metrics
2 participants