adding account info into labels
See original GitHub issuesetup:
- using make_app() factory pattern
question:
- I want to add a label containing account_id :
def make_app():
metrics._static_labels = {"account_id": current_user.id}
metrics.init_app(app)
return app
but obviously, I get current_user
:None
because metrics.init_app(app) and make_app() is called before the app get account info .
any idea on how to set label containing account_id in make_app() ?
I have tried using lambda: request.account.id
but it doesn’t give me the result, rather it gave a function object
- I have tried using
lambda: request.account.id
-> returns<function make_app.<locals>.<lambda> at 0x7f28b6d4b730>
- tried
PrometheusMetrics(app, group_by=custom_rule)
-> but this is about we add another default metrics, not a label.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Print labels for your mailing list - Microsoft Support
In the Mail Merge menu, select Labels. · Choose Select recipients > Browse to upload the mailing list. · Select Arrange your labels...
Read more >Create labels to organize Gmail - Computer - Google Support
Label a message you're writing. On your computer, go to Gmail. Click Compose. ... Click Label, then select labels you want to add....
Read more >How to Make Address Address Labels with Mail Merge using ...
Use Mail Merge to Create Mailing Labels in Word from an Excel Data Set · How to print mailing labels from Excel ·...
Read more >Mail Merge Address Labels (FREE) with Google Docs, Sheets ...
Generate mailing lables from a spreadsheet of addresses for free using Google Docs, Google Sheets, and Autocrat (free add on ).
Read more >Print mailing labels, envelopes, and contact lists in Contacts ...
Click Layout or Label to customize mailing labels. Layout: Choose a page type, such as Avery Standard or A4. Or choose Define Custom...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thank you, you rock! @rycus86
Managed to make this work now, the
account_id: lamdba: request.account.id
form should work. Also renamedstatic_labels
todefault_labels
(though the former will still work).Hopefully this helps!