Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.

Feat: Add Prometheus http api query client sdk #78

Merged
merged 47 commits into from
Jun 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c5836e9
feat: add promethus http api query client
Qinyouzeng Jun 14, 2022
c771526
feat: add test project
Qinyouzeng Jun 14, 2022
e39384e
feat: api query add
Qinyouzeng Jun 16, 2022
2923da4
feat: update code and add tests
Qinyouzeng Jun 17, 2022
cbde367
docs: add docs
Qinyouzeng Jun 17, 2022
3af77c1
feat: add convert json value to object
Qinyouzeng Jun 17, 2022
98cb7c9
feat: fix enume and comments
Qinyouzeng Jun 20, 2022
b659739
feat: code styles and other specifications update
Qinyouzeng Jun 21, 2022
743b82d
feat: update callerprovider inject
Qinyouzeng Jun 21, 2022
477691b
feat: update jsonelement convert to obj
Qinyouzeng Jun 21, 2022
89ed2eb
feat: update extensions
Qinyouzeng Jun 22, 2022
b21d163
feat: update internal to public
Qinyouzeng Jun 22, 2022
b57c468
feat: update directory
Qinyouzeng Jun 23, 2022
4496cea
feat: test refrence update
Qinyouzeng Jun 24, 2022
e2f5835
chore: comments and filename update
Qinyouzeng Jun 24, 2022
5c2d798
chore: remove not exists project id
Qinyouzeng Jun 28, 2022
d22d39c
chore: update docs and code style
Qinyouzeng Jun 28, 2022
9a747bb
chore: enums update
Qinyouzeng Jun 28, 2022
d942218
chore: doc code style update
Qinyouzeng Jun 30, 2022
39246f3
chore: dosc update
Qinyouzeng Jun 30, 2022
5a93140
chore: docs update
Qinyouzeng Jun 30, 2022
8e1c4b0
feat: add promethus http api query client
Qinyouzeng Jun 14, 2022
782fa15
feat: add test project
Qinyouzeng Jun 14, 2022
6a4ff0f
feat: api query add
Qinyouzeng Jun 16, 2022
99a0e1a
feat: update code and add tests
Qinyouzeng Jun 17, 2022
f7a571f
docs: add docs
Qinyouzeng Jun 17, 2022
64676e0
feat: add convert json value to object
Qinyouzeng Jun 17, 2022
fac4870
feat: fix enume and comments
Qinyouzeng Jun 20, 2022
d32c669
feat: code styles and other specifications update
Qinyouzeng Jun 21, 2022
7fa9168
feat: update callerprovider inject
Qinyouzeng Jun 21, 2022
5d8a1eb
feat: update jsonelement convert to obj
Qinyouzeng Jun 21, 2022
6c011e8
feat: update extensions
Qinyouzeng Jun 22, 2022
ed59bfb
feat: update internal to public
Qinyouzeng Jun 22, 2022
00fb2bc
feat: update directory
Qinyouzeng Jun 23, 2022
90b5e6f
feat: test refrence update
Qinyouzeng Jun 24, 2022
fef4606
chore: comments and filename update
Qinyouzeng Jun 24, 2022
7b33de8
chore: remove not exists project id
Qinyouzeng Jun 28, 2022
9952add
chore: update docs and code style
Qinyouzeng Jun 28, 2022
9847a88
chore: enums update
Qinyouzeng Jun 28, 2022
5c4dfe7
chore: doc code style update
Qinyouzeng Jun 30, 2022
d3822ae
chore: dosc update
Qinyouzeng Jun 30, 2022
5912f21
chore: docs update
Qinyouzeng Jun 30, 2022
2e5437a
Merge branch 'feature/promethus-query-client' of https://github.com/m…
Qinyouzeng Jun 30, 2022
e36ed26
chore: name update and remove no used files
Qinyouzeng Jun 30, 2022
f36051d
chore: folder name update
Qinyouzeng Jun 30, 2022
7ae8db6
chore: file rename
Qinyouzeng Jun 30, 2022
fcd3447
chore: class split
Qinyouzeng Jun 30, 2022
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
Prev Previous commit
chore: class split
Qinyouzeng committed Jun 30, 2022
commit fcd34478dd51dff9c99afba24cadc74190f059c9
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.Utils.Data.Prometheus.Model;

public class ExemplarModel
{
public IDictionary<string, object>? Labels { get; set; }

public string? Value { get; set; }

public float TimeStamp { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.Utils.Data.Prometheus.Model;

public class ExemplarDataModel
{
public IDictionary<string, object>? SeriesLabels { get; set; }

public IEnumerable<ExemplarModel>? Exemplars { get; set; }
}
Original file line number Diff line number Diff line change
@@ -7,19 +7,3 @@ public class ExemplarResultResponse : ResultBaseResponse
{
public IEnumerable<ExemplarDataModel>? Data { get; set; }
}

public class ExemplarModel
{
public IDictionary<string, object>? Labels { get; set; }

public string? Value { get; set; }

public float TimeStamp { get; set; }
}

public class ExemplarDataModel
{
public IDictionary<string, object>? SeriesLabels { get; set; }

public IEnumerable<ExemplarModel>? Exemplars { get; set; }
}
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ namespace Masa.Utils.Data.Prometheus;

public static class ServiceCollectionExtensions
{
private const string Prometheus_HTTP_CLIENT_NAME = "prometheus_client_name";
private const string PROMETHEUS_HTTP_CLIENT_NAME = "prometheus_client_name";

public static IServiceCollection AddPrometheusClient(this IServiceCollection services, string url)
{
@@ -19,7 +19,7 @@ public static IServiceCollection AddPrometheusClient(this IServiceCollection ser
builder.UseHttpClient(options =>
{
options.BaseAddress = url;
options.Name = Prometheus_HTTP_CLIENT_NAME;
options.Name = PROMETHEUS_HTTP_CLIENT_NAME;
});
});

@@ -31,7 +31,7 @@ public static IServiceCollection AddPrometheusClient(this IServiceCollection ser

services.AddScoped<IMasaPrometheusClient>(ServiceProvider =>
{
var caller = ServiceProvider.GetRequiredService<ICallerFactory>().CreateClient(Prometheus_HTTP_CLIENT_NAME);
var caller = ServiceProvider.GetRequiredService<ICallerFactory>().CreateClient(PROMETHEUS_HTTP_CLIENT_NAME);
return new MasaPrometheusClient(caller, jsonOptions);
});
return services;