Skip to content

Commit 64595d4

Browse files
authored
Merge pull request prometheus#4135 from dimahsu/add-full-width-to-adaptive-card-for-msteamsv2
Add full width to adaptive card for msteamsv2
2 parents 6e7d493 + d18797b commit 64595d4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

notify/msteamsv2/msteamsv2.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ type Notifier struct {
5151

5252
// https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#adaptivecarditemschema
5353
type Content struct {
54-
Schema string `json:"$schema"`
55-
Type string `json:"type"`
56-
Version string `json:"version"`
57-
Body []Body `json:"body"`
54+
Schema string `json:"$schema"`
55+
Type string `json:"type"`
56+
Version string `json:"version"`
57+
Body []Body `json:"body"`
58+
Msteams Msteams `json:"msteams,omitempty"`
5859
}
5960

6061
type Body struct {
@@ -67,6 +68,10 @@ type Body struct {
6768
Color string `json:"color,omitempty"`
6869
}
6970

71+
type Msteams struct {
72+
Width string `json:"width"`
73+
}
74+
7075
type Attachment struct {
7176
ContentType string `json:"contentType"`
7277
ContentURL *string `json:"contentUrl"` // Use a pointer to handle null values
@@ -167,6 +172,9 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
167172
Text: text,
168173
},
169174
},
175+
Msteams: Msteams{
176+
Width: "full",
177+
},
170178
},
171179
},
172180
},

0 commit comments

Comments
 (0)