Skip to content

Commit fe8cb5c

Browse files
[O11y][GoLang] Resolve the conflict in host.ip field (#7494)
* revert changes * update PR link in changelog.yml file * address review comments
1 parent 38c21e3 commit fe8cb5c

File tree

6 files changed

+200
-1
lines changed

6 files changed

+200
-1
lines changed

packages/golang/_dev/build/docs/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,100 @@ You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommen
3535

3636
For step-by-step instructions on how to set up an integration, see the [Getting started](https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html) guide.
3737

38+
### Troubleshooting
39+
40+
If host.ip is shown conflicted under ``logs-*`` data view, then this issue can be solved by reindexing the ``Heap`` and ``Expvar`` data stream's indices.
41+
To reindex the data, the following steps must be performed.
42+
43+
1. Stop the data stream by going to `Integrations -> Golang -> Integration policies` open the configuration of Golang and disable the `Collect Golang metrics` toggle to reindex metrics data stream and save the integration.
44+
45+
2. Copy data into the temporary index and delete the existing data stream and index template by performing the following steps in the Dev tools.
46+
47+
```
48+
POST _reindex
49+
{
50+
"source": {
51+
"index": "<index_name>"
52+
},
53+
"dest": {
54+
"index": "temp_index"
55+
}
56+
}
57+
```
58+
Example:
59+
```
60+
POST _reindex
61+
{
62+
"source": {
63+
"index": "logs-golang.heap-default"
64+
},
65+
"dest": {
66+
"index": "temp_index"
67+
}
68+
}
69+
```
70+
71+
```
72+
DELETE /_data_stream/<data_stream>
73+
```
74+
Example:
75+
```
76+
DELETE /_data_stream/logs-golang.heap-default
77+
```
78+
79+
```
80+
DELETE _index_template/<index_template>
81+
```
82+
Example:
83+
```
84+
DELETE _index_template/logs-golang.heap
85+
```
86+
3. Go to `Integrations -> Golang -> Settings` and click on `Reinstall Golang`.
87+
88+
4. Copy data from temporary index to new index by performing the following steps in the Dev tools.
89+
90+
```
91+
POST _reindex
92+
{
93+
"conflicts": "proceed",
94+
"source": {
95+
"index": "temp_index"
96+
},
97+
"dest": {
98+
"index": "<index_name>",
99+
"op_type": "create"
100+
101+
}
102+
}
103+
```
104+
Example:
105+
```
106+
POST _reindex
107+
{
108+
"conflicts": "proceed",
109+
"source": {
110+
"index": "temp_index"
111+
},
112+
"dest": {
113+
"index": "logs-golang.heap-default",
114+
"op_type": "create"
115+
116+
}
117+
}
118+
```
119+
120+
5. Verify data is reindexed completely.
121+
122+
6. Start the data stream by going to the `Integrations -> Golang -> Integration policies` and open configuration of integration and enable the `Collect Golang metrics` toggle and save the integration.
123+
124+
7. Delete temporary index by performing the following step in the Dev tools.
125+
126+
```
127+
DELETE temp_index
128+
```
129+
130+
More details about reindexing can be found [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html).
131+
38132
## Logs reference
39133

40134
### expvar

packages/golang/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "0.4.1"
3+
changes:
4+
- description: Resolve the conflict in host.ip field.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/7494
27
- version: "0.4.0"
38
changes:
49
- description: Rename ownership from obs-service-integrations to obs-infraobs-integrations

packages/golang/data_stream/expvar/fields/ecs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
name: event.original
1919
- external: ecs
2020
name: event.type
21+
- external: ecs
22+
name: host.ip
2123
- external: ecs
2224
name: service.address

packages/golang/data_stream/heap/fields/ecs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
name: event.original
1919
- external: ecs
2020
name: event.type
21+
- external: ecs
22+
name: host.ip
2123
- external: ecs
2224
name: service.address

packages/golang/docs/README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,100 @@ You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommen
3535

3636
For step-by-step instructions on how to set up an integration, see the [Getting started](https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html) guide.
3737

38+
### Troubleshooting
39+
40+
If host.ip is shown conflicted under ``logs-*`` data view, then this issue can be solved by reindexing the ``Heap`` and ``Expvar`` data stream's indices.
41+
To reindex the data, the following steps must be performed.
42+
43+
1. Stop the data stream by going to `Integrations -> Golang -> Integration policies` open the configuration of Golang and disable the `Collect Golang metrics` toggle to reindex metrics data stream and save the integration.
44+
45+
2. Copy data into the temporary index and delete the existing data stream and index template by performing the following steps in the Dev tools.
46+
47+
```
48+
POST _reindex
49+
{
50+
"source": {
51+
"index": "<index_name>"
52+
},
53+
"dest": {
54+
"index": "temp_index"
55+
}
56+
}
57+
```
58+
Example:
59+
```
60+
POST _reindex
61+
{
62+
"source": {
63+
"index": "logs-golang.heap-default"
64+
},
65+
"dest": {
66+
"index": "temp_index"
67+
}
68+
}
69+
```
70+
71+
```
72+
DELETE /_data_stream/<data_stream>
73+
```
74+
Example:
75+
```
76+
DELETE /_data_stream/logs-golang.heap-default
77+
```
78+
79+
```
80+
DELETE _index_template/<index_template>
81+
```
82+
Example:
83+
```
84+
DELETE _index_template/logs-golang.heap
85+
```
86+
3. Go to `Integrations -> Golang -> Settings` and click on `Reinstall Golang`.
87+
88+
4. Copy data from temporary index to new index by performing the following steps in the Dev tools.
89+
90+
```
91+
POST _reindex
92+
{
93+
"conflicts": "proceed",
94+
"source": {
95+
"index": "temp_index"
96+
},
97+
"dest": {
98+
"index": "<index_name>",
99+
"op_type": "create"
100+
101+
}
102+
}
103+
```
104+
Example:
105+
```
106+
POST _reindex
107+
{
108+
"conflicts": "proceed",
109+
"source": {
110+
"index": "temp_index"
111+
},
112+
"dest": {
113+
"index": "logs-golang.heap-default",
114+
"op_type": "create"
115+
116+
}
117+
}
118+
```
119+
120+
5. Verify data is reindexed completely.
121+
122+
6. Start the data stream by going to the `Integrations -> Golang -> Integration policies` and open configuration of integration and enable the `Collect Golang metrics` toggle and save the integration.
123+
124+
7. Delete temporary index by performing the following step in the Dev tools.
125+
126+
```
127+
DELETE temp_index
128+
```
129+
130+
More details about reindexing can be found [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html).
131+
38132
## Logs reference
39133

40134
### expvar
@@ -174,6 +268,7 @@ An example event for `expvar` looks as following:
174268
| golang.expvar.obtained.total.bytes | The total bytes of memory obtained from the OS. | long | byte | gauge |
175269
| golang.expvar.pointer.lookups | The number of pointer lookups performed by the runtime. | long | | gauge |
176270
| golang.expvar.stack.bytes | Bytes in stack spans. | long | byte | gauge |
271+
| host.ip | Host ip addresses. | ip | | |
177272
| input.type | Type of Filebeat input. | keyword | | |
178273
| service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | |
179274
| tags | List of keywords used to tag each event. | keyword | | |
@@ -318,6 +413,7 @@ An example event for `heap` looks as following:
318413
| golang.heap.system.released.bytes | Bytes of physical memory returned to the OS. | long | byte | gauge |
319414
| golang.heap.system.stack.bytes | Bytes of stack memory obtained from the OS. | long | byte | gauge |
320415
| golang.heap.system.total.bytes | Bytes of heap memory obtained from the OS. | long | byte | gauge |
416+
| host.ip | Host ip addresses. | ip | | |
321417
| input.type | Type of Filebeat input. | keyword | | |
322418
| service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | |
323419
| tags | List of keywords used to tag each event. | keyword | | |

packages/golang/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: 2.0.0
22
name: golang
33
title: Golang
4-
version: "0.4.0"
4+
version: "0.4.1"
55
description: This Elastic integration collects metrics from Golang applications.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)