Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
OpenTelemetry.OpAmp.Client.Listeners.IOpAmpListener<TMessage>
OpenTelemetry.OpAmp.Client.Listeners.IOpAmpListener<TMessage>.HandleMessage(TMessage! message) -> void
OpenTelemetry.OpAmp.Client.Messages.AgentConfigFile
OpenTelemetry.OpAmp.Client.Messages.AgentConfigFile.Body.get -> System.ReadOnlySpan<byte>
OpenTelemetry.OpAmp.Client.Messages.AgentConfigFile.ContentType.get -> string?
OpenTelemetry.OpAmp.Client.Messages.AgentConfigFile.Name.get -> string!
OpenTelemetry.OpAmp.Client.Messages.OpAmpMessage
OpenTelemetry.OpAmp.Client.Messages.OpAmpMessage.OpAmpMessage() -> void
OpenTelemetry.OpAmp.Client.Messages.RemoteConfigMessage
OpenTelemetry.OpAmp.Client.Messages.RemoteConfigMessage.AgentConfigMap.get -> System.Collections.Generic.IReadOnlyDictionary<string!, OpenTelemetry.OpAmp.Client.Messages.AgentConfigFile!>!
OpenTelemetry.OpAmp.Client.Messages.RemoteConfigMessage.ConfigHash.get -> System.ReadOnlySpan<byte>
OpenTelemetry.OpAmp.Client.OpAmpClient
OpenTelemetry.OpAmp.Client.OpAmpClient.Dispose() -> void
OpenTelemetry.OpAmp.Client.OpAmpClient.OpAmpClient(System.Action<OpenTelemetry.OpAmp.Client.Settings.OpAmpClientSettings!>? configure = null) -> void
Expand Down
5 changes: 5 additions & 0 deletions src/OpenTelemetry.OpAmp.Client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
* Add setting to configure the factory used to create `HttpClient` instances
used for the OpAMP Plain HTTP transport.
([#3589](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3589))

* Add support for subscribing and unsubscribing to messages from the OpAMP server.
([#3593](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3593))

* Clean up directories and namespaces for public API.
([#3612](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3612))

* Expose public `RemoteConfigMessage`.
([#3614](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3614))

## 0.1.0-alpha.3

Released 2025-Nov-13
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using Google.Protobuf;

namespace OpenTelemetry.OpAmp.Client.Messages;

/// <summary>
/// Represents an agent configuration file.
/// </summary>
public class AgentConfigFile
{
private readonly ByteString body;

internal AgentConfigFile(string name, global::OpAmp.Proto.V1.AgentConfigFile agentConfigFile)
{
this.body = agentConfigFile.Body ?? ByteString.Empty;
this.ContentType = agentConfigFile.ContentType;
this.Name = name;
}

/// <summary>
/// Gets the byte content of the configuration file.
/// </summary>
public ReadOnlySpan<byte> Body => this.body.Span;

/// <summary>
/// Gets the MIME Content-Type that describes the data contained in the body of the remote configuration file.
/// </summary>
public string? ContentType { get; }

/// <summary>
/// Gets the name of this configuration file.
/// </summary>
public string Name { get; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using Google.Protobuf;
using OpAmp.Proto.V1;

namespace OpenTelemetry.OpAmp.Client.Messages;

/// <summary>
/// Represents an OpAMP server-to-agent remote configuration message.
/// </summary>
public class RemoteConfigMessage : OpAmpMessage
{
private readonly Dictionary<string, AgentConfigFile> agentConfigMap;
private readonly ByteString configHash;

internal RemoteConfigMessage(AgentRemoteConfig agentRemoteConfig)
{
this.agentConfigMap = new Dictionary<string, AgentConfigFile>(agentRemoteConfig.Config.ConfigMap.Count, StringComparer.Ordinal);

foreach (var config in agentRemoteConfig.Config.ConfigMap)
{
// The value should never be null, but just in case...
if (config.Value is not null)
{
this.agentConfigMap[config.Key] = new AgentConfigFile(config.Key, config.Value);
}
}

this.configHash = agentRemoteConfig.ConfigHash;
}

/// <summary>
/// Gets a dictionary of agent configuration files, keyed by the name of the configuration file.
/// </summary>
public IReadOnlyDictionary<string, AgentConfigFile> AgentConfigMap => this.agentConfigMap;

/// <summary>
/// Gets the hash value representing the current remote configuration.
/// </summary>
public ReadOnlySpan<byte> ConfigHash => this.configHash.Span;
}
Loading