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 FaaS metrics semantic conventions #1736

Merged
merged 10 commits into from
Aug 10, 2021
Merged

Conversation

skonto
Copy link
Contributor

@skonto skonto commented May 31, 2021

Fixes #1013

Changes

Adds metrics and metric labels for functions

I am proposing also changing the faas prefix to func as not all environments are of that kind.
Do I need to discuss that change in a WG meeting?

/cc @kolanos @kenfinnigan @jmacd

@skonto skonto requested review from a team May 31, 2021 11:29
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 31, 2021

CLA Signed

The committers are authorized under a signed CLA.

@arminru
Copy link
Member

arminru commented May 31, 2021

@skonto The namespace/prefix is shared with the trace and resource semantic conventions:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/faas.md

If you think changing it would make sense for all three of them, please open a separate issue to discuss this.

@arminru arminru added area:semantic-conventions Related to semantic conventions enhancement New feature or request spec:metrics Related to the specification/metrics directory labels May 31, 2021
@skonto
Copy link
Contributor Author

skonto commented May 31, 2021

@arminru

If you think changing it would make sense for all three of them, please open a separate issue to discuss this.

Yes that is why I set this PR to wip, wanted see if I can do it here, but I agree better to start a discussion first.

@skonto skonto changed the title [wip] Add function metrics spec (faas) [wip] Add FaaS metrics semantic conventions Jun 1, 2021
@skonto skonto changed the title [wip] Add FaaS metrics semantic conventions Add FaaS metrics semantic conventions Jun 1, 2021
@kenfinnigan
Copy link
Member

Question for maintainers. What are the expectations around duplication of data, or preferences for where it resides?

Taking a specific example, the faas.invoked_name, etc labels can be found if a Resource with that information is set, correct? Should the specification be preferring the information being set in a Resource and that resource is then attached to the metric, vs labels with identical information being added?

@github-actions
Copy link

github-actions bot commented Jun 9, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@skonto
Copy link
Contributor Author

skonto commented Jun 9, 2021

@arminru gentle ping for review.

@arminru
Copy link
Member

arminru commented Jun 9, 2021

Question for maintainers. What are the expectations around duplication of data, or preferences for where it resides?

Taking a specific example, the faas.invoked_name, etc labels can be found if a Resource with that information is set, correct? Should the specification be preferring the information being set in a Resource and that resource is then attached to the metric, vs labels with identical information being added?

@kenfinnigan
Only the following FaaS attributes are defined for the resource: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/faas.md
There is no overlap with the metrics attributes added by this PR as far as I can see.

@arminru
Copy link
Member

arminru commented Jun 9, 2021

@open-telemetry/specs-metrics-approvers @reyang @jmacd Could you please take a look?

@kenfinnigan
Copy link
Member

Question for maintainers. What are the expectations around duplication of data, or preferences for where it resides?
Taking a specific example, the faas.invoked_name, etc labels can be found if a Resource with that information is set, correct? Should the specification be preferring the information being set in a Resource and that resource is then attached to the metric, vs labels with identical information being added?

@kenfinnigan
Only the following FaaS attributes are defined for the resource: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/faas.md
There is no overlap with the metrics attributes added by this PR as far as I can see.

Would faas.invoked_name here be the same as faas.name on the Resource?

I also wasn't sure whether there would be overlap between faas.invoked_provider here, and cloud.provider on the cloud resource: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md

@arminru
Copy link
Member

arminru commented Jun 9, 2021

Would faas.invoked_name here be the same as faas.name on the Resource?

I also wasn't sure whether there would be overlap between faas.invoked_provider here, and cloud.provider on the cloud resource: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md

@kenfinnigan In the trace semantic conventions things are quite clear since incoming and outgoing invocations are distinguished clearly. In tracing, faas.invoked_name on the client span which is invoking the function would be the same as the faas.name resource attribute on the function being invoked.
I would think that this convention here would follow the same semantics, so a faas.invoked_name label and faas.name resource attribute would only be present on the same process if it is a function itself (faas.name) making an outgoing call to yet another function (faas.invoked_name). It would, however, only have the same value if it would call itself recursively.
Likewise for faas.invoked_provider and cloud.provider. A process running in Google cloud would have cloud.provider=gcp set on its resource and if it had a metric tracking outgoing invocations towards a Lambda function would the label faas.invoked_provider=aws set, for example.

@skonto I think it would make sense to use the same structure as in the trace semantic conventions (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md) here as well to make this clearer.

@kenfinnigan
Copy link
Member

@arminru Thanks for the detail. The piece I was missing is that metrics could have an equivalent "in process" and "outgoing" as traces, as I'd presumed metrics would only be dealing with the current process only

@skonto
Copy link
Contributor Author

skonto commented Jun 9, 2021

@arminru Yes I can do that

@kenfinnigan

as I'd presumed metrics would only be dealing with the current process only

I thought the same but then it might be the case that we have a metric that counts invocations from within a process
and may tag the metric with that label explicitly (at least to count all invocations including the failed ones as you cant count anything if the outgoing function fails). I am not stating this is the only way to do this but since this is a spec we probably want to allow such scenarios. Glad we clarified that.

@github-actions github-actions bot removed the Stale label Jun 10, 2021
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 16, 2021

CLA Signed

The committers are authorized under a signed CLA.

@skonto
Copy link
Contributor Author

skonto commented Jun 16, 2021

@arminru I updated the spec, I dont want to repeat the info at the trace side (added a link), however I changed the structure according to other metrics specs.

@skonto
Copy link
Contributor Author

skonto commented Jul 12, 2021

Ok I will update this.

@skonto
Copy link
Contributor Author

skonto commented Jul 12, 2021

@arminru I updated the instrument types, regarding the other update you mention, I suspect the resource labels can be mixed in with the ones in this PR if they have to, I am not sure if I need to reference them though at all.
For example there is no need to reference here: function.name unless I misunderstood something.

Copy link
Member

@arminru arminru left a comment

Choose a reason for hiding this comment

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

@skonto Thanks! Seems like the PR I referred to only added to the FaaS trace semconv but did not touch the attributes which you took over, so no need for updating then. The resource attributes don't have to recited here, yes.

@open-telemetry/specs-metrics-approvers Please take a look.

CHANGELOG.md Outdated Show resolved Hide resolved
specification/metrics/semantic_conventions/faas-metrics.md Outdated Show resolved Hide resolved
specification/metrics/semantic_conventions/faas-metrics.md Outdated Show resolved Hide resolved
@arminru arminru requested review from jsuereth, reyang and jmacd July 14, 2021 16:39
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the Stale label Jul 23, 2021
Copy link
Member

@arminru arminru left a comment

Choose a reason for hiding this comment

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

Thanks, @skonto!

@arminru arminru requested a review from a team July 23, 2021 11:51
@arminru arminru removed the Stale label Jul 23, 2021
@carlosalberto
Copy link
Contributor

@open-telemetry/specs-metrics-approvers Please take a look and review/approve.

@github-actions
Copy link

github-actions bot commented Aug 4, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 4, 2021
@skonto
Copy link
Contributor Author

skonto commented Aug 4, 2021

@jmacd gentle ping, can I get merge pls?

@github-actions github-actions bot removed the Stale label Aug 5, 2021
@jmacd jmacd merged commit 1433e3f into open-telemetry:main Aug 10, 2021
carlosalberto added a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Define FaaS Metric Semantics

Closes open-telemetry#1013

* adjust faas metrics

* fixes

* docs

* updates

* fixes

* update instruments

* use attributes

Co-authored-by: Michael Lavers <[email protected]>
Co-authored-by: Carlos Alberto Cortez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions enhancement New feature or request spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define metric semantic conventions for FaaS
7 participants