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

feat: Metrics tracer addAttribute map overload #3202

Merged
merged 5 commits into from
Sep 16, 2024

Conversation

surbhigarg92
Copy link
Contributor

@surbhigarg92 surbhigarg92 commented Sep 16, 2024

This PR adds an overload for adding multiple attributes at once.

Earlier the client had to call the addAttributes method in a loop to add each attributes. Below overload takes a map and add all the attributes at once

public void addAttributes(Map<String, String> attributes) {
    this.attributes.putAll(attributes);
  };

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Sep 16, 2024
Copy link

sonarcloud bot commented Sep 16, 2024

Copy link

sonarcloud bot commented Sep 16, 2024

Quality Gate Failed Quality Gate failed for 'java_showcase_integration_tests'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@blakeli0
Copy link
Collaborator

/gcbrun

@blakeli0 blakeli0 merged commit 1a988df into googleapis:main Sep 16, 2024
45 of 47 checks passed
@surbhigarg92 surbhigarg92 deleted the metricsTracerAddAttribute branch September 17, 2024 04:04
ldetmer pushed a commit that referenced this pull request Sep 17, 2024
This PR adds an overload for adding multiple attributes at once. 

Earlier the client had to call the `addAttributes` method in a loop to
add each attributes. Below overload takes a map and add all the
attributes at once

```
public void addAttributes(Map<String, String> attributes) {
    this.attributes.putAll(attributes);
  };
 ```

---------

Co-authored-by: Blake Li <[email protected]>
@lqiu96
Copy link
Contributor

lqiu96 commented Sep 18, 2024

@surbhigarg92

I believe we're seeing some downstream errors in Java-Spanner related to this PR:

Error:  Failures: 
Error:    CompositeTracerTest.testMethodsOverrideMetricsTracer:238 Method not found in compositeTracerMethods: public void com.google.api.gax.tracing.MetricsTracer.addAttributes(java.util.Map)

From a quick glance, it seems like test expects the CompositeTracer to have an override for addAttributes(java.util.Map). Is this something that Spanner is planning on adding or is there a way to resolve this error in Spanner's tests (or maybe a different resolution)?

CC: @JoeWang1127

@surbhigarg92
Copy link
Contributor Author

@surbhigarg92

I believe we're seeing some downstream errors in Java-Spanner related to this PR:

Error:  Failures: 
Error:    CompositeTracerTest.testMethodsOverrideMetricsTracer:238 Method not found in compositeTracerMethods: public void com.google.api.gax.tracing.MetricsTracer.addAttributes(java.util.Map)

From a quick glance, it seems like test expects the CompositeTracer to have an override for addAttributes(java.util.Map). Is this something that Spanner is planning on adding or is there a way to resolve this error in Spanner's tests (or maybe a different resolution)?

CC: @JoeWang1127

@lqiu96 Will be fixing this in Spanner

lqiu96 pushed a commit that referenced this pull request Sep 23, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.46.0</summary>

##
[2.46.0](v2.45.0...v2.46.0)
(2024-09-23)


### Features

* expose property in GrpcTransportChannel if it uses direct path.
([#3170](#3170))
([9a432f7](9a432f7))
* generate a GAPIC library from api definition
([#3208](#3208))
([b6b5d7b](b6b5d7b))
* Metrics tracer addAttribute map overload
([#3202](#3202))
([1a988df](1a988df))


### Bug Fixes

* generate pr description with repo level change
([#3182](#3182))
([edd2168](edd2168))


### Dependencies

* update dependency com.google.errorprone:error_prone_annotations to
v2.32.0
([#3192](#3192))
([b280706](b280706))
* update dependency com.google.errorprone:error_prone_annotations to
v2.32.0
([#3193](#3193))
([ed0cd17](ed0cd17))
* update dependency filelock to v3.16.1
([#3210](#3210))
([703ac3d](703ac3d))
* update dependency idna to v3.10
([#3201](#3201))
([211c3ec](211c3ec))
* update dependency org.threeten:threetenbp to v1.7.0
([#3205](#3205))
([c88a722](c88a722))
* update dependency org.threeten:threetenbp to v1.7.0
([#3206](#3206))
([3e9fbac](3e9fbac))
* update dependency platformdirs to v4.3.3
([#3200](#3200))
([b62b05d](b62b05d))
* update dependency platformdirs to v4.3.6
([#3209](#3209))
([227ffa5](227ffa5))
* update dependency urllib3 to v2.2.3
([#3194](#3194))
([f69d511](f69d511))
* update dependency virtualenv to v20.26.5
([#3212](#3212))
([d3ef97a](d3ef97a))
* update google api dependencies
([#3183](#3183))
([02eea8d](02eea8d))
* update google auth library dependencies to v1.26.0
([#3216](#3216))
([0b369e9](0b369e9))
* update google auth library dependencies to v1.27.0
([#3221](#3221))
([a3cb9e7](a3cb9e7))
* update googleapis/java-cloud-bom digest to 06f632d
([#3198](#3198))
([49dcd35](49dcd35))
* update googleapis/java-cloud-bom digest to e7d8909
([#3207](#3207))
([de497ee](de497ee))
* update opentelemetry-java monorepo to v1.42.1
([#3189](#3189))
([38117d8](38117d8))
* Upgrade Protobuf-Java to v3.25.5
([#3217](#3217))
([860c1bc](860c1bc))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants