-
Notifications
You must be signed in to change notification settings - Fork 558
[WIP]: Add OpenTelemetry metrics support for XDS Client #1127
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
7a43c50
54a8401
0df69f4
ea5faa4
e9155b3
5cd8559
f710f7e
4effe1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| Copyright (c) 2025 LinkedIn Corp. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package com.linkedin.d2.jmx; | ||
|
|
||
| /** | ||
| * Common constants used across D2 JMX and metrics components. | ||
| */ | ||
| public final class D2JmxConstants | ||
|
||
| { | ||
| /** | ||
| * Default client name used when a specific client name is not set. | ||
| * Used for identifying metrics associated with unnamed clients. | ||
| */ | ||
| public static final String NO_VALUE = "-"; | ||
|
|
||
| private D2JmxConstants() | ||
| { | ||
| // Utility class, prevent instantiation | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| package com.linkedin.d2.jmx; | ||
|
|
||
| /** | ||
| * No-Op implementation of {@link XdsClientOtelMetricsProvider}. | ||
| * Used when OpenTelemetry metrics are disabled. | ||
| */ | ||
| public class NoOpXdsClientOtelMetricsProvider implements XdsClientOtelMetricsProvider { | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docstring
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
| public void recordConnectionLost(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordConnectionClosed(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordReconnection(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordRequestSent(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordResponseReceived(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordInitialResourceVersionSent(String clientName, int count) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordResourceNotFound(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordResourceInvalid(String clientName) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void recordServerLatency(String clientName, long latencyMs) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void updateConnectionState(String clientName, boolean isConnected) { | ||
| // No-op | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void updateActiveInitialWaitTime(String clientName, long waitTimeMs) { | ||
| // No-op | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also licensing here