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

[BUILD] DLL export interface for Metrics #2344

Merged
merged 13 commits into from
Oct 23, 2023

Conversation

perhapsmaple
Copy link
Contributor

Fixes #2313

Changes

Add Metrics classes to exported DLL interface.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
@perhapsmaple perhapsmaple requested a review from a team October 7, 2023 17:16
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 7, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@perhapsmaple perhapsmaple changed the title [WIP] DLL export interface for Metrics DLL export interface for Metrics Oct 7, 2023
@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #2344 (4a08f95) into main (f16deb0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2344   +/-   ##
=======================================
  Coverage   87.43%   87.43%           
=======================================
  Files         199      199           
  Lines        6030     6030           
=======================================
  Hits         5272     5272           
  Misses        758      758           

Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
@@ -1,6 +1,12 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
Copy link
Member

Choose a reason for hiding this comment

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

This is not a problem of this PR, but I think we should use if(OPENTELEMETRY_BUILD_DLL) instead of if(DEFINED OPENTELEMETRY_BUILD_DLL). And use target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_BUILD_IMPORT_DLL) instead of add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL), so we can exporting this definition to cmake package.

ThomsonTan and others added 2 commits October 16, 2023 09:34
Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
@lalitb
Copy link
Member

lalitb commented Oct 17, 2023

Thanks for the contribution. The PR looks good. The current CI is only executing traces example as here -

examples\simple\Debug\example_simple.exe

Should we also add the metrics example here, to validate that the example is using the DLL correctly.

Signed-off-by: Harish Shan <140232061+perhapsmaple@users.noreply.github.com>
@perhapsmaple
Copy link
Contributor Author

Hi, I have added both the metrics and logs tests to the cmake.dll.test workflow. Let me know if any other changes are required. Thanks

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks. Good to have @ThomsonTan approval before merging, as he wrote the initial DLL code.

Copy link
Contributor

@ThomsonTan ThomsonTan left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.

@marcalff marcalff changed the title DLL export interface for Metrics [BUILD] DLL export interface for Metrics Oct 23, 2023
@marcalff marcalff merged commit 045be9c into open-telemetry:main Oct 23, 2023
44 checks passed
@meastp
Copy link
Contributor

meastp commented Oct 27, 2023

@perhapsmaple thanks a lot for working on this! we discovered this today. we have been trying to modify otel-cpp locally to add metrics support for windows dll - we are however having some build issues. Could you please have a look, perhaps you can help us solve it? :) #2202 (comment)

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.

DLL export interface for Metrics
7 participants