question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to set multiple tags at the same time

See original GitHub issue

Today we have a setTag(key, value) function which allows you to set a tag on the current transaction.

As discussed on the APM forum, it would be nice to be able to set more than one tag at a time.

Since the existing setTag is singular, I’m thinking it’s better to create a new function. We can keep supporting both functions or we can deprecate the old one. I’m not sure what’s best.

Proposed new API:

agent.setTags({key1: 'value', key2: 'value'})

Questions:

  • Should we deprecate setTag or keep supporting it?
  • Should it be possible to clear the already set tags, or will calling setTags multiple times just add to the list of tags?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
AdriVanHoudtcommented, Dec 16, 2017

The object + set implies full overwrite instead of merge to me

0reactions
watsoncommented, Dec 18, 2017

@Qard I think with for instance addTags() we’ll not want to do anything if there isn’t currently an active transaction. It could be that instrumentation have been disabled, or we’re sampling and this current request hasn’t been chosen as a sample, or simply that there’s a bug where we have lost context due to an un-patched async operation. We have have the same issue with agent.buildSpan() btw, this will return null instead of a span if there isn’t an active transaction so all subsequent calls to span.* needs to have a guard before it. So it would be cool if we could find a solution to this that made the API simpler to work with 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a class to multiple tags in a form at the same time
Use , to seperate selectors. $("[name='" + value + "'],#checkbox-group1,form").addClass("h-red");.
Read more >
Add ability to add multiple tags with docker build #863 - GitHub
I have some automated builds using docker build and a Dockerfile . With docker build -t <tag> I can set a tag for...
Read more >
Setting multiple tags to the same value in one command
I have a number of tags I'd like to set to the same value (taken from another tag). I know I can write...
Read more >
Ability to type multiple tags separated by commas - Tropy
In most tagging software I've used you can add multiple tags at once by typing them all in the entry field, separated by...
Read more >
Organize your reminders with tags on iPhone - Apple Support
You can add one or more tags to a reminder, such as #shopping and #work, and easily search and filter your reminders across...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found