-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(datadog): add source type name to datadog #3342
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6755bbb
Add source type name to datadog
matthewelwell 57cfd81
Try to add inputType to integrations
matthewelwell 54facdc
Default to true for all new configs
matthewelwell aa3b2cf
Add docs
matthewelwell a160162
Remove redundant (stale) images
matthewelwell e6ff0c1
Add source type name to datadog
matthewelwell a245560
chore: Add input type to base input component (#3344)
kyle-ssg c178a55
Add default to integration data
matthewelwell c7e7756
Fix unit test
matthewelwell 3cda141
PR review feedback
matthewelwell 3c4b10d
Merge branch 'main' into feat(datadog)/custom-source-type
matthewelwell c60d111
Fix incorrect id
kyle-ssg f507b2c
Fix integration field input
kyle-ssg ee63076
Fix field check
kyle-ssg c042dfa
q?
kyle-ssg 0ac67c4
Prepopulate integration data with default values
kyle-ssg 1cf58ab
Merge branch 'main' into feat(datadog)/custom-source-type
matthewelwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
api/integrations/datadog/migrations/0004_add_use_custom_source.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.23 on 2024-01-29 15:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('datadog', '0003_datadogconfiguration_deleted_at'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='datadogconfiguration', | ||
name='use_custom_source', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,10 @@ The second type of integration allows you to send Flag change events in Flagsmit | |
4. Add the Datadog URL into Flagsmith as the Base URL - (This is either `https://api.datadoghq.com/` or | ||
`https://api.datadoghq.eu/`) | ||
|
||
 | ||
### Custom Source | ||
|
||
 | ||
Comment on lines
-45
to
-47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These were old, stale, images that I think are not necessary. The documentation is clear enough and these images will always become stale over time. |
||
By checking the 'Use Custom Source' option, we will send all events with the source 'Flagsmith'. Leaving this unchecked | ||
will mean events are labelled with the default 'My apps' source. | ||
|
||
Flag change events will now be sent to Datadog. | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useRef } from 'react' | ||
import ReactMarkdown from 'react-markdown' | ||
import Icon from 'components/Icon' | ||
import Utils from 'common/utils/utils' | ||
|
||
interface CheckboxProps { | ||
label: string | ||
onChange: (value: boolean) => void | ||
checked: boolean | ||
id?: string | ||
} | ||
|
||
const Checkbox: React.FC<CheckboxProps> = ({ | ||
checked, | ||
id, | ||
label, | ||
onChange, | ||
}) => { | ||
const idRef = useRef(id || Utils.GUID()) | ||
const handleChange = () => { | ||
onChange(!checked) | ||
} | ||
|
||
return ( | ||
<> | ||
<input id={idRef.current} type='checkbox' /> | ||
<label | ||
onClick={handleChange} | ||
className='mb-0' | ||
htmlFor={idRef.current} | ||
style={{ display: 'inline' }} | ||
> | ||
<span className='checkbox mr-2'> | ||
{checked && <Icon name='checkmark-square' />} | ||
</span> | ||
{label} | ||
</label> | ||
</> | ||
) | ||
} | ||
|
||
export default Checkbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me think that
use_custom_source
defaulting toFalse
is kinda backwards, isn't it? Shouldn't we always default to usingflagsmith
as the source for our very own wrapper around data dog?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the issue here is backwards compatibility. If existing customers that are using the datadog integration have filtering rules set up based on the previous (default) source type, then releasing this for all users would break those rules. I've added the default as False, then changed it at the model level to True so that all new instances get the custom source type name.