HttpReports 基于.NET Core 开发的APM监控系统,使用MIT开源协议,主要功能包括,统计, 分析, 可视化, 监控,追踪等,适合在微服务环境中使用。
官方地址:https://www.yuque.com/httpreports/docs/uyaiil
- 主な機能 **
- インタフェース呼び出しメトリック分析
- マルチサービス·ノードのデータ集約分析
- 遅いリクエスト、エラーリクエスト分析
- インタフェース呼び出しログクエリ{{いんたふぇ ーすきだしろぐくえり}}
- 複数のタイプのアラート監視
- HTTP、Grpc呼び出しプロファイリング
- 分散追跡システム
- 複数のデータベースをサポートし、統合が便利
- プログラムのパフォーマンス監視
最初のステップ
打开 VS 新建.NET 项目我这里用的是.NET Core Web API 进行演示
第二のステップ
使用NuGet安装MHttpReports.Dashboard包和HttpReports.SqlServer

第三のステップ
appsetting.jsonの設定
{
"HttpReportsDashboard": {
"ExpireDay": 3,
"Storage": {
"ConnectionString": "Server=10.1.30.252;Database=GEISDB;user id=sa;password=Mg2021;",
"DeferSecond": 10,
"DeferThreshold": 100
},
"Check": {
"Mode": "Self",
"Switch": true,
"Endpoint": "",
"Range": "500,2000"
},
"Mail": {
"Server": "smtp.163.com",
"Port": 465,
"Account": "HttpReports@qq.com",
"Password": "*******",
"EnableSsL": true,
"Switch": true
}
}
}
** パラメータの紹介 **
- ExpireDay-データの有効期限(デフォルトでは3日間)。HttpReportsは期限切れのデータを自動的に消去します。
- Storage -情報の保存
- DeferSecond -バルク·データが入りされる秒数。推奨値は5 ~ 60
- DeferThreshold -バルク·データ·インレットの数、推奨値は100 ~ 1000
- Mail-メールボックス情報、監視を設定するとアラートメールを送信できます。
- チェック-ヘルスチェックの設定、詳細はヘルスチェックページを参照。
第四のステップ
Startupの
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpReportsDashboard().AddSQLServerStorage();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHttpReportsDashboard();
}
Dashboardプログラムを起動し、問題がなければ、Dashboardのログインページに移動します。

默认账号:admin
密码: 123456
Dashboardビジュアライゼーションができましたが、データがないので、サーバーにHttpReportsを追加して情報を収集する必要があります。
5番目のステップ
我新建一个 WebAPI 项目 UserService ,来充当用户服务,然后安装 HttpReports,HttpReports.Transport.Http

6番目のステップ
修改 Services 的Appsettings.json 简单配置一下
{
"HttpReports": {
"Transport": {
"CollectorAddress": "http://localhost:5000/",
"DeferSecond": 10,
"DeferThreshold": 100
},
"Server": "http://localhost:7000",
"Service": "User",
"Switch": true,
"RequestFilter": ["/api/health/*", "/HttpReports*"],
"WithRequest": true,
"WithResponse": true,
"WithCookie": true,
"WithHeader": true
}
}
** パラメータの紹介 **
Transport -
CollectorAddress-データ送信先のアドレス、ダッシュボードのプロジェクトアドレスを構成する
DeferSecond -バルク·データが入りされる秒数。推奨値は5 ~ 60
DeferThreshold -バルク·データ·インレットの数、推奨値は100 ~ 300
Server -サービスのアドレス、
Service -サービスの名前
Switch-データ収集を有効にする
RequestFilter-データフィルタリング、* でファジーマッチする
WithRequest-インタフェースのエントリを記録するかどうか
WithResponse-インタフェースのアウト引数を記録するかどうか
WithCookie-Cookie情報を記録するかどうか
WithHeader-リクエストヘッダー情報を記録するかどうか。
最後のステップ。
我们接着修改 UserService 项目的 Startup.cs 文件
app.UseHttpReports(); 这一行最好放到 Configure 方法 最上面
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpReports().AddHttpTransport();
services.AddControllers();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHttpReports();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
刷新下 UserService 的接口,再回到Dashboard的页面上面,已经可以看到数据了

まとめまとめまとめ
HttpReportsを使ったインターフェース統計、分析、可視化、監視、追跡などを行ってみてください。