Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea
Tor
Commits
472c7127
Commit
472c7127
authored
3 years ago
by
David Goulet
Browse files
Options
Downloads
Plain Diff
Merge branch 'maint-0.4.5' into maint-0.4.6
parents
5afdc851
9efb04bb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/ticket40581
+4
-0
4 additions, 0 deletions
changes/ticket40581
src/feature/hs/hs_metrics.c
+15
-8
15 additions, 8 deletions
src/feature/hs/hs_metrics.c
with
19 additions
and
8 deletions
changes/ticket40581
0 → 100644
+
4
−
0
View file @
472c7127
o Minor bugfixes (metrics port, onion service):
- Fix the metrics with a port label to be unique. Before this, all ports of
an onion service would be on the same line which violates the Prometheus
rules of unique labels. Fixes bug 40581; bugfix on 0.4.5.1-alpha.
This diff is collapsed.
Click to expand it.
src/feature/hs/hs_metrics.c
+
15
−
8
View file @
472c7127
...
...
@@ -59,19 +59,26 @@ init_store(hs_service_t *service)
store
=
service
->
metrics
.
store
;
for
(
size_t
i
=
0
;
i
<
base_metrics_size
;
++
i
)
{
metrics_store_entry_t
*
entry
=
metrics_store_add
(
store
,
base_metrics
[
i
].
type
,
base_metrics
[
i
].
name
,
base_metrics
[
i
].
help
);
/* Add labels to the entry. */
metrics_store_entry_add_label
(
entry
,
format_label
(
"onion"
,
service
->
onion_address
));
/* Add entries with port as label. We need one metric line per port. */
if
(
base_metrics
[
i
].
port_as_label
&&
service
->
config
.
ports
)
{
SMARTLIST_FOREACH_BEGIN
(
service
->
config
.
ports
,
const
hs_port_config_t
*
,
p
)
{
metrics_store_entry_t
*
entry
=
metrics_store_add
(
store
,
base_metrics
[
i
].
type
,
base_metrics
[
i
].
name
,
base_metrics
[
i
].
help
);
/* Add labels to the entry. */
metrics_store_entry_add_label
(
entry
,
format_label
(
"onion"
,
service
->
onion_address
));
metrics_store_entry_add_label
(
entry
,
format_label
(
"port"
,
port_to_str
(
p
->
virtual_port
)));
format_label
(
"port"
,
port_to_str
(
p
->
virtual_port
)));
}
SMARTLIST_FOREACH_END
(
p
);
}
else
{
metrics_store_entry_t
*
entry
=
metrics_store_add
(
store
,
base_metrics
[
i
].
type
,
base_metrics
[
i
].
name
,
base_metrics
[
i
].
help
);
metrics_store_entry_add_label
(
entry
,
format_label
(
"onion"
,
service
->
onion_address
));
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment