Motadata.CustomInstrumentationTest 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Motadata.CustomInstrumentationTest --version 1.0.0
                    
NuGet\Install-Package Motadata.CustomInstrumentationTest -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Motadata.CustomInstrumentationTest" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Motadata.CustomInstrumentationTest" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Motadata.CustomInstrumentationTest" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Motadata.CustomInstrumentationTest --version 1.0.0
                    
#r "nuget: Motadata.CustomInstrumentationTest, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Motadata.CustomInstrumentationTest@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Motadata.CustomInstrumentationTest&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Motadata.CustomInstrumentationTest&version=1.0.0
                    
Install as a Cake Tool

Motadata Custom Instrumentation

Custom instrumentation utility for OpenTelemetry spans in .NET applications. Provides easy-to-use APIs for setting custom attributes on spans with automatic validation and type conversion.

🚀 Features

  • ✅ Easy-to-use API - Simple static methods for setting span attributes
  • ✅ Automatic key prefixing - All keys automatically prefixed with apm.
  • ✅ Type safety - Support for bool, int, long, float, double, string, and arrays
  • ✅ Validation - Built-in validation for keys and values with descriptive error messages
  • ✅ Cross-platform - Works on Windows, Linux, and macOS
  • ✅ Multi-framework support - .NET Framework 4.6.2+, .NET Standard 2.0, .NET 8, .NET 9

📦 Installation

NuGet Package Manager

dotnet add package Motadata.CustomInstrumentationTest

Package Manager Console

Install-Package Motadata.CustomInstrumentationTest

🔧 Usage

Basic Examples

using Motadata.Apm;

// Set scalar attributes
CustomInstrumentation.Set("user.id", 12345);
CustomInstrumentation.Set("user.name", "John Doe");
CustomInstrumentation.Set("is.premium", true);
CustomInstrumentation.Set("response.time", 123.45);
CustomInstrumentation.Set("temperature", 98.6f);
CustomInstrumentation.Set("count", 42L);

// Set array attributes
CustomInstrumentation.SetStringList("tags", new[] { "api", "v2", "production" });
CustomInstrumentation.SetLongList("user.ids", new[] { 1L, 2L, 3L });
CustomInstrumentation.SetIntegerList("scores", new[] { 100, 95, 87 });
CustomInstrumentation.SetDoubleList("metrics", new[] { 1.1, 2.2, 3.3 });
CustomInstrumentation.SetFloatList("temperatures", new[] { 98.6f, 99.1f, 97.8f });
CustomInstrumentation.SetBooleanList("flags", new[] { true, false, true });

Automatic Key Prefixing

All attribute keys are automatically prefixed with apm.:

CustomInstrumentation.Set("user.id", 12345);
// Actual key set on span: "apm.user.id"

CustomInstrumentation.Set("apm.user.name", "John");
// Key already has prefix, so it remains: "apm.user.name"

Error Handling

try
{
    CustomInstrumentation.Set("user.id", 12345);
}
catch (InvalidAttributeKeyException ex)
{
    // Invalid key format
    Console.WriteLine($"Invalid key: {ex.Message}");
}
catch (InvalidAttributeValueException ex)
{
    // Invalid value (null, NaN, Infinity, etc.)
    Console.WriteLine($"Invalid value: {ex.Message}");
}
catch (SpanAttributeException ex)
{
    // No active span or span error
    Console.WriteLine($"Span error: {ex.Message}");
}

📋 Supported Types

Scalar Types

  • bool - Boolean values
  • int - Integer values (converted to long)
  • long - Long integer values
  • float - Float values (converted to double)
  • double - Double precision values
  • string - String values (cannot be null)

Array Types

  • bool[] - Boolean arrays
  • int[] - Integer arrays (converted to long[])
  • long[] - Long integer arrays
  • float[] - Float arrays (converted to double[])
  • double[] - Double precision arrays
  • string[] - String arrays (null values filtered out)

⚙️ Validation Rules

Key Validation

  • ✅ Cannot be null or empty
  • ✅ Only alphanumeric characters and dots allowed
  • ✅ Automatically converted to lowercase
  • ✅ Automatically prefixed with apm.

Value Validation

  • ✅ String values cannot be null
  • ✅ Double/Float values cannot be NaN or Infinity
  • ✅ Arrays cannot be null or empty
  • ✅ Null values in arrays are automatically filtered out
  • ✅ Invalid values (NaN, Infinity) in arrays are filtered out

🌍 Platform Support

Platform Supported Frameworks
Windows .NET Framework 4.6.2, 4.7, 4.8<br>.NET 8, .NET 9
Linux .NET 8, .NET 9<br>.NET Standard 2.0
macOS .NET 8, .NET 9<br>.NET Standard 2.0

📖 API Reference

Scalar Methods

  • Set(string key, bool value)
  • Set(string key, int value)
  • Set(string key, long value)
  • Set(string key, float value)
  • Set(string key, double value)
  • Set(string key, string value)

Array Methods

  • SetBooleanList(string key, bool[] value)
  • SetIntegerList(string key, int[] value)
  • SetLongList(string key, long[] value)
  • SetFloatList(string key, float[] value)
  • SetDoubleList(string key, double[] value)
  • SetStringList(string key, string[] value)

🔒 License

Proprietary - Copyright (c) Motadata 2026. All rights reserved.

📞 Support

For issues, questions, or support:

📝 Notes

This is a TEST VERSION for evaluation purposes. For production use, please contact Motadata.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated

TEST VERSION v1.0.0 - Custom instrumentation utility for OpenTelemetry spans (Testing on personal account)