Prometheus.EntityFramework 1.0.0

Prometheus EntityFramework Monitoring Middleware

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
Install-Package Prometheus.EntityFramework -Version 1.0.0
dotnet add package Prometheus.EntityFramework --version 1.0.0
<PackageReference Include="Prometheus.EntityFramework" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Prometheus.EntityFramework --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Prometheus.EntityFramework, 1.0.0"
For F# scripts that support #r syntax, copy this into the source code to reference the package.
// Install Prometheus.EntityFramework as a Cake Addin
#addin nuget:?package=Prometheus.EntityFramework&version=1.0.0

// Install Prometheus.EntityFramework as a Cake Tool
#tool nuget:?package=Prometheus.EntityFramework&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Prometheus Entity Framework

Why Just .NET Framework 4.6.1

Currently this package is only supported for .Net Framework 4.6.1 because of dependencies.

Dependency net40 net461 netcoreapp1.3 netcoreapp2.2
EF Interceptions TRUE TRUE FALSE FALSE
Prometheus.Client FALSE TRUE TRUE TRUE

Usage

  • Install and configure Prometheus.Client.Owin package.
  • Install this project package (Which is not available yet).
  • Create Interceptor options.
public class MyPrometheusInterceptorOptions : PrometheusInterceptorOptions
{
  public override bool ReaderNotLogged => true;

  public class MyPrometheusInterceptorOptions : PrometheusInterceptorOptions
  {
    public override void Executed<T>(DbCommand command,
      DbCommandInterceptionContext<T> interceptionContext,
      Stopwatch stopwatch,
      InterceptedMethod interceptedMethod)
    {
      var labels = new[] {"CommandText", "Database", "DataSource", "ExceptionOccured"};
      var values = new[] {command.CommandText, command.Connection.Database, command.Connection.DataSource, (interceptionContext.Exception != null).ToString() };
      Metrics.CreateGauge("LogName", "Log Help Text", labels)
        .Labels(values)
        .Set(stopwatch.ElapsedMilliseconds);
    }
  }
}
  • Create a DbConfiguration or update existing.
public class MyPrometheusDbConfiguration : DbConfiguration
{
  public MyPrometheusDbConfiguration()
  {
    AddInterceptor(new PrometheusDbCommandInterceptor(new MyPrometheusInterceptorOptions()));
  }
}
  • Use Configuration above DbContext
[DbConfigurationType(typeof(MyPrometheusDbConfiguration))]
public class MyDbContext : DbContext
{
  public MyDbContext(string name) : base(name) {}
  ...
}

Project Plan

  • Support .NET Framework
  • Support Customizable Metrics
  • Create Nuget package
  • Support .NET Core
  • Create Test Projects
  • Source Code Documentation

Prometheus Entity Framework

Why Just .NET Framework 4.6.1

Currently this package is only supported for .Net Framework 4.6.1 because of dependencies.

Dependency net40 net461 netcoreapp1.3 netcoreapp2.2
EF Interceptions TRUE TRUE FALSE FALSE
Prometheus.Client FALSE TRUE TRUE TRUE

Usage

  • Install and configure Prometheus.Client.Owin package.
  • Install this project package (Which is not available yet).
  • Create Interceptor options.
public class MyPrometheusInterceptorOptions : PrometheusInterceptorOptions
{
  public override bool ReaderNotLogged => true;

  public class MyPrometheusInterceptorOptions : PrometheusInterceptorOptions
  {
    public override void Executed<T>(DbCommand command,
      DbCommandInterceptionContext<T> interceptionContext,
      Stopwatch stopwatch,
      InterceptedMethod interceptedMethod)
    {
      var labels = new[] {"CommandText", "Database", "DataSource", "ExceptionOccured"};
      var values = new[] {command.CommandText, command.Connection.Database, command.Connection.DataSource, (interceptionContext.Exception != null).ToString() };
      Metrics.CreateGauge("LogName", "Log Help Text", labels)
        .Labels(values)
        .Set(stopwatch.ElapsedMilliseconds);
    }
  }
}
  • Create a DbConfiguration or update existing.
public class MyPrometheusDbConfiguration : DbConfiguration
{
  public MyPrometheusDbConfiguration()
  {
    AddInterceptor(new PrometheusDbCommandInterceptor(new MyPrometheusInterceptorOptions()));
  }
}
  • Use Configuration above DbContext
[DbConfigurationType(typeof(MyPrometheusDbConfiguration))]
public class MyDbContext : DbContext
{
  public MyDbContext(string name) : base(name) {}
  ...
}

Project Plan

  • Support .NET Framework
  • Support Customizable Metrics
  • Create Nuget package
  • Support .NET Core
  • Create Test Projects
  • Source Code Documentation

Release Notes

Initialize package.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated