-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
刘江波
committed
Dec 20, 2024
1 parent
dacd457
commit 4b6bfd5
Showing
19 changed files
with
506 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from prometheus_client import Counter, Histogram | ||
|
||
from configs import dify_config | ||
|
||
app_request = Counter( | ||
name="app_request", | ||
documentation="The total count of APP requests", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
) | ||
app_request_failed = Counter( | ||
name="app_request_failed", | ||
documentation="The failed count of APP requests", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
) | ||
app_request_latency = Histogram( | ||
name="app_request_latency", | ||
documentation="The latency of APP requests", | ||
unit="seconds", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
buckets=dify_config.HISTOGRAM_BUCKETS_5MIN, | ||
) | ||
app_input_tokens = Counter( | ||
name="app_input_tokens", | ||
documentation="The input tokens cost by APP requests", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
) | ||
app_output_tokens = Counter( | ||
name="app_output_tokens", | ||
documentation="The output tokens cost by APP requests", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
) | ||
app_total_tokens = Counter( | ||
name="app_total_tokens", | ||
documentation="The total tokens cost by APP requests", | ||
labelnames=["app_id", "tenant_id", "username"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.