Tags
Tags are key-value pairs that help you categorize and filter errors. Use them to add context like version numbers, feature flags, or deployment information.
Why Use Tags?
Tags help you:
- Filter errors by specific criteria
- Group errors by feature, version, or environment
- Identify patterns across different segments
- Track errors related to specific deployments
Setting Tags
Laravel / PHP
use Alertiqo\Laravel\Facades\Alertiqo;
// Set a single tag
Alertiqo::setTag('feature', 'checkout');
// Set multiple tags
Alertiqo::setTags([
'version' => '2.0.0',
'subscription' => 'premium',
'server' => 'web-01'
]);
JavaScript
// Set a single tag
alertiqo.setTag('feature', 'checkout');
// Set multiple tags
alertiqo.setTags({
version: '2.0.0',
subscription: 'premium',
browser: 'chrome'
});
Node.js
// Set a single tag
alertiqo.setTag('feature', 'checkout');
// Set multiple tags
alertiqo.setTags({
version: '2.0.0',
subscription: 'premium',
server: 'api-01'
});
Python
# Set a single tag
alertiqo.set_tag("feature", "checkout")
# Set multiple tags
alertiqo.set_tags({
"version": "2.0.0",
"subscription": "premium",
"server": "api-01"
})
Go
// Set a single tag
client.SetTag("feature", "checkout")
// Set multiple tags
client.SetTags(map[string]string{
"version": "2.0.0",
"subscription": "premium",
"server": "api-01",
})
Ruby
# Set a single tag
Alertiqo.set_tag("feature", "checkout")
# Set multiple tags
Alertiqo.set_tags({
version: "2.0.0",
subscription: "premium",
server: "api-01"
})
Default Tags
You can set default tags during initialization that will be applied to all errors:
Laravel / PHP
// In config/alertiqo.php
'tags' => [
'app' => 'my-app',
'server' => env('SERVER_NAME', 'unknown'),
],
JavaScript / Node.js
const alertiqo = new Alertiqo({
apiKey: 'your-api-key',
endpoint: 'https://alertiqo.io',
tags: {
app: 'my-app',
version: '1.0.0'
}
});
Common Tag Examples
| Tag | Example Values | Use Case |
|---|---|---|
version |
1.0.0, 2.1.3 | Track errors by app version |
feature |
checkout, auth, dashboard | Group errors by feature area |
server |
web-01, api-02 | Identify problematic servers |
subscription |
free, pro, enterprise | Prioritize by customer tier |
region |
us-east, eu-west | Track regional issues |
deployment |
abc123, deploy-456 | Track deployment-specific errors |
Best Practices
- Use consistent tag names across your application
- Keep tag values simple and filterable
- Avoid high-cardinality tags (e.g., user IDs as tags)
- Use tags for categorization, not for storing data
- Set default tags for common values like version and environment