Formatting events submitted via the api or dogstatsd

We have adopted Daring Fireball's Markdown throughout our site.

So when commenting an event or setting up a monitor text you can use double underscores to italicize a word etc.

However events created via the api or dogstatsd will not see any formatting applied by default.

To add formatting you need to add a separate line with a triple % to begin and end the section where markdown is enabled. 

Example with the python api library:

api_key='<YOUR_API_KEY>'

from datadog import initialize,api

options = {
'api_key': api_key
}

initialize(**options)

title = "test with Markdown"
text = """This **section** will not have any formatting applied.
%%%
Here **the markdown** will work
%%%"""
tags = ['test:markdown']

api.Event.create(title = title, text=text, tags=tags)

Example with the python dogstatsd library:

from datadog import statsd

title = "test with Markdown"
text = """This **section** will not have any formatting applied.
%%%
Here **the markdown** will work
%%%"""
tags = ['test:markdown']

statsd.event(title = title, text=text, tags=tags)

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk