oracledb_exporter icon indicating copy to clipboard operation
oracledb_exporter copied to clipboard

level=error msg="error gathering metrics, was collected before with the same name and label values

Open 3DPIT opened this issue 4 years ago • 0 comments

problem error

time="2021-10-13T01:08:19Z" level=error msg="error gathering metrics: collected metric \"oracledb_performance_serial\" { label:<name:\"client_info\" value:\"0\" > label:<name:\"lockwait\" value:\"0\" > label:<name:\"logon_time\" value:\"2021-10-13 10:08:02 +0000 UTC\" > label:<name:\"machine\" value:\"223b62570776\" > label:<name:\"module\" value:\"oracledb_exporter@223b62570776(TNSV1-V3)\" > label:<name:\"osuser\" value:\"appuser\" > label:<name:\"program1\" value:\"oracledb_exporter@223b62570776(TNSV1-V3)\" > label:<name:\"program2\" value:\"ORACLE.EXE(SHAD)\" > label:<name:\"server\" value:\"DEDICATED\" > label:<name:\"status\" value:\"ACTIVE\" > label:<name:\"terminal\" value:\"pts/0\" > label:<name:\"type\" value:\"USER\" > label:<name:\"username\" value:\"PCCUSER\" > gauge:<value:62978 > } was collected before with the same name and label values\n" source="log.go:181

The above is the current error.

source code sql (problem)

[[metric]]
context = "performance"
labels = ["status", "type","username", "osuser", "server", "machine", "module","client_info","terminal","program1","program2","logon_time","lockwait"]
metricsdesc = { serial ="serial#"}
request = '''
SELECT S.STATUS, 
               S.SERIAL# as serial,
               S.TYPE, 
               S.USERNAME, 
               TRIM(REGEXP_REPLACE(S.OSUSER,' ', ''))as osuser,
               S.SERVER, 
               S.MACHINE,
               TRIM(REGEXP_REPLACE(S.MODULE,' ', ''))as module, 
               nvl(S.CLIENT_INFO,0)as client_info,
               S.TERMINAL, 
               TRIM(REGEXP_REPLACE(S.PROGRAM,' ', ''))as program1, 
               TRIM(REGEXP_REPLACE( P.PROGRAM,' ', ''))as program2,  
               S.LOGON_TIME, 
                nvl(LOCKWAIT,0)as lockwait
          FROM V$SESSION S, V$PROCESS P, SYS.V_$SESS_IO SI
         WHERE S.PADDR = P.ADDR(+)
           AND SI.SID(+) = S.SID
           AND S.USERNAME IS NOT NULL
           AND (NVL(S.OSUSER,'x') <> 'SYSTEM')
           AND (S.TYPE <> 'BACKGROUND')
         ORDER BY S.LOGON_TIME DESC  
'''

Currently, when I put the sql statement like this, an error occurs.

What's causing this error?

Is there any way to solve the problem?

3DPIT avatar Oct 13 '21 01:10 3DPIT