Skip to content

Commit 8f96ee0

Browse files
authored
Merge pull request #298 from digma-ai/feature/span_entry_group
support insight entry point of span type
2 parents b5c7bb7 + 2013c75 commit 8f96ee0

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

model/src/main/kotlin/org/digma/intellij/plugin/model/rest/insights/EndpointSchema.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class EndpointSchema {
1212
const val HTTP_SCHEMA: String = "epHTTP"
1313
const val RPC_SCHEMA: String = "epRPC"
1414
const val CONSUMER_SCHEMA: String = "epConsumer"
15+
const val SPAN_SCHEMA: String = "epSpan"
16+
1517

1618
@JvmStatic
1719
fun getRouteInfo(fullRouteName: String): RouteInfo {
@@ -35,6 +37,9 @@ class EndpointSchema {
3537
if (isOfType(fullRouteName, CONSUMER_SCHEMA)) {
3638
return CONSUMER_SCHEMA
3739
}
40+
if (isOfType(fullRouteName, SPAN_SCHEMA)) {
41+
return SPAN_SCHEMA
42+
}
3843
return ""
3944
}
4045

@@ -58,8 +63,9 @@ class EndpointSchema {
5863
if (isOfType(origValue, CONSUMER_SCHEMA)) {
5964
return
6065
}
66+
return
6167
// default behaviour, to be backward compatible, where did not have the scheme part of the route, so adding it as HTTP one
62-
endpointInsight.route = "$HTTP_SCHEMA:$origValue"
68+
//endpointInsight.route = "$HTTP_SCHEMA:$origValue"
6369
}
6470
}
6571
}

model/src/test/kotlin/org/digma/intellij/plugin/model/rest/insights/EndpointSchemaTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class EndpointSchemaTest {
3232
val codeObjectId = "123"
3333
val normalUsageInsight = NormalUsageInsight(codeObjectId, "env1", "scope1", 3, null, "get /yes", "endpointSpan1", actualStartTimeNow, customStartTimeFiveDaysBefore, addPrefixToCodeObjectId(codeObjectId), 3)
3434
adjustHttpRouteIfNeeded(normalUsageInsight)
35-
assertEquals("epHTTP:get /yes", normalUsageInsight.route)
35+
assertEquals("get /yes", normalUsageInsight.route)
3636
}
3737

3838
@Test

src/main/kotlin/org/digma/intellij/plugin/ui/list/insights/InsightsListCellRenderer.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import org.digma.intellij.plugin.model.rest.insights.*
88
import org.digma.intellij.plugin.model.rest.insights.EndpointSchema.Companion.CONSUMER_SCHEMA
99
import org.digma.intellij.plugin.model.rest.insights.EndpointSchema.Companion.HTTP_SCHEMA
1010
import org.digma.intellij.plugin.model.rest.insights.EndpointSchema.Companion.RPC_SCHEMA
11+
import org.digma.intellij.plugin.model.rest.insights.EndpointSchema.Companion.SPAN_SCHEMA
12+
1113
import org.digma.intellij.plugin.ui.common.*
1214
import org.digma.intellij.plugin.ui.list.AbstractPanelListCellRenderer
1315
import org.digma.intellij.plugin.ui.list.PanelsLayoutHelper
@@ -113,6 +115,9 @@ class InsightsListCellRenderer : AbstractPanelListCellRenderer() {
113115
if(routeInfo.schema == CONSUMER_SCHEMA){
114116
return GroupViewModel(asHtml(span(endpoint)), Laf.Icons.Insight.MESSAGE)
115117
}
118+
if(routeInfo.schema == SPAN_SCHEMA){
119+
return GroupViewModel(asHtml(span(endpoint)), Laf.Icons.Insight.TELESCOPE)
120+
}
116121
return GroupViewModel(asHtml(""), Laf.Icons.Insight.INTERFACE)
117122
}
118123

0 commit comments

Comments
 (0)