-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support to provide tags with value in Gauge metric (#13994)
* Adds support to provide tags with value in Gauge metric Signed-off-by: Gagan Juneja <[email protected]> * Adds support to provide tags with value in Gauge metric Signed-off-by: Gagan Juneja <[email protected]> * Adds support to provide tags with value in Gauge metric Signed-off-by: Gagan Juneja <[email protected]> * Adds build issue Signed-off-by: Gagan Juneja <[email protected]> * Fix compilation issue Signed-off-by: Gagan Juneja <[email protected]> * Empty-Commit Signed-off-by: Gagan Juneja <[email protected]> * Empty-Commit Signed-off-by: Gagan Juneja <[email protected]> --------- Signed-off-by: Gagan Juneja <[email protected]> Signed-off-by: Gagan Juneja <[email protected]> Co-authored-by: Gagan Juneja <[email protected]>
- Loading branch information
1 parent
270054c
commit 24d7069
Showing
11 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
libs/telemetry/src/main/java/org/opensearch/telemetry/metrics/TaggedMeasurement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.telemetry.metrics; | ||
|
||
import org.opensearch.common.annotation.ExperimentalApi; | ||
import org.opensearch.telemetry.metrics.tags.Tags; | ||
|
||
/** | ||
* Observable Measurement for the Asynchronous instruments. | ||
* @opensearch.experimental | ||
*/ | ||
@ExperimentalApi | ||
public final class TaggedMeasurement { | ||
private final Double value; | ||
private final Tags tags; | ||
|
||
/** | ||
* Factory method to create the {@link TaggedMeasurement} object. | ||
* @param value value. | ||
* @param tags tags to be added per value. | ||
* @return tagged measurement TaggedMeasurement | ||
*/ | ||
public static TaggedMeasurement create(double value, Tags tags) { | ||
return new TaggedMeasurement(value, tags); | ||
} | ||
|
||
private TaggedMeasurement(double value, Tags tags) { | ||
this.value = value; | ||
this.tags = tags; | ||
} | ||
|
||
/** | ||
* Returns the value. | ||
* @return value | ||
*/ | ||
public Double getValue() { | ||
return value; | ||
} | ||
|
||
/** | ||
* Returns the tags. | ||
* @return tags | ||
*/ | ||
public Tags getTags() { | ||
return tags; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters