Skip to content

Commit

Permalink
Removing prometheus-net dependency (#1526)
Browse files Browse the repository at this point in the history
* Update README.md

* Update KubernetesClient.csproj

* Delete examples/prometheus directory

* Delete src/KubernetesClient/PrometheusHandler.cs
  • Loading branch information
rkarg-blizz committed Feb 26, 2024
1 parent c15d79d commit 93140a6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 100 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ You should also be able to authenticate with the in-cluster service
account using the `InClusterConfig` function shown below.

## Monitoring
There is optional built-in metric generation for prometheus client metrics.
The exported metrics are:
Metrics are built in to HttpClient using System.Diagnostics.DiagnosticsSource.
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/built-in-metrics-system-net

* `k8s_dotnet_request_total` - Counter of request, broken down by HTTP Method
* `k8s_dotnet_response_code_total` - Counter of responses, broken down by HTTP Method and response code
* `k8s_request_latency_seconds` - Latency histograms broken down by method, api group, api version and resource kind

There is an example integrating these monitors in the examples/prometheus directory.
There are many ways these metrics can be consumed/exposed but that decision is up to the application, not KubernetesClient itself.
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics-collection

## Sample Code

Expand Down
29 changes: 0 additions & 29 deletions examples/prometheus/Prometheus.cs

This file was deleted.

7 changes: 0 additions & 7 deletions examples/prometheus/prometheus.csproj

This file was deleted.

3 changes: 1 addition & 2 deletions src/KubernetesClient/KubernetesClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="prometheus-net" Version="8.2.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />
<PackageReference Include="IdentityModel.OidcClient" Version="5.2.1" />
<PackageReference Include="Fractions" Version="7.3.0" />
Expand All @@ -22,4 +21,4 @@
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
</Project>
55 changes: 0 additions & 55 deletions src/KubernetesClient/PrometheusHandler.cs

This file was deleted.

0 comments on commit 93140a6

Please sign in to comment.