# Retrieve "History Driver" and "History Provider" for Remote Tag Providers

**URL:** <https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868>\
**Category:** Module Development\
**Created:** [February 26, 2025, 12:28am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868 "2025-02-26T00:28:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [February 26, 2025, 12:28am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/1 "2025-02-26T00:28:56Z")

</div>

From within an Ignition module (in Java), In order to query the correct tagids in the SQL Historian where a Remote Tag Provider is involved, my understanding is that you must know the "History Driver" and "History Provider" values that can be seen in the settings below. What is the supported way of retrieving these values, if there is one?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/d/3da07e18fbcd92f77e15543c3c6a1dd37e35c0f2.png)

If there's not an officially supported way, then I'd like to resort to reflection. I can see in the debugger that these values ARE available on the RemoteTagProvider object, they are in the "settings" field as part of an array. Does the offset into this array change or can I assume that these values are always at indexes 7 and 8?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/27d786421fec9dd10d5a385e1517111afbf50b69.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 26, 2025, 12:33am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/2 "2025-02-26T00:33:46Z")

</div>

I'm pretty sure the order of those are "stable" unless we happened to re-order the fields in `RemoteTagProviderSettings`, which seems unlikely.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2025, 12:43am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/3 "2025-02-26T00:43:19Z")

</div>

See this topic for a detailed discussion:

> [@Remote Tag Provider History Queries](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632):
>
> I'm working on a couple tasks related to historians and history queries, and have encountered some behaviors of remote tag providers (RTPs) that have me stymied: There's no public way to retrieve the gateway name that a RTP is pointing at, nor any public way to retrieve the far end's real tag provider name. (Reflection has exposed com.inductiveautomation.ignition.gateway.tags.distributed.client.RemoteTagProvider and com.inductiveautomation.metro.api.ServerId to me, and a number of private fie…

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [February 26, 2025, 12:53am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/4 "2025-02-26T00:53:38Z")

</div>

@pturmel -- what specific reflection did you end up doing? Did you access the "settings" field and use a hard-coded offset?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2025, 12:55am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/5 "2025-02-26T00:55:24Z")

</div>

I did not look at the settings record at all, just the live RTP object retrieved from the gateway context. See that topic's linked Exchange Resource for actual code examples.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [February 26, 2025, 1:07am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/6 "2025-02-26T01:07:44Z")

</div>

@pturmel I think you're talking about this comment [Remote Tag Provider History Queries - #29 by pturmel](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632/29) which links to this site [https://www.automation-pros.com/TagReportUtility/](https://www.automation-pros.com/TagReportUtility/) which has a ZIP file in it. I downloaded the ZIP file and I see what looks to be some Java-like code in some Python files... I looked in providers/code.py but I'm not seeing the obvious place that you're retrieving "History Driver" and "History Provider".

I apologize if I'm being dense... could you be a bit more specific on what code retrieves these?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2025, 1:15am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/7 "2025-02-26T01:15:06Z")

</div>

Start with line 37 for the reflection setup. Look at line 204 for the reflection usage.

Consider importing the project and running it to get a feel for how it works.

(That comment also links to a complete topic describing the whole resource.)

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [February 26, 2025, 1:53am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/8 "2025-02-26T01:53:57Z")

</div>

Thanks, now I see. That code appears to retrieve the "Gateway" and "Provider" values within the "Remote Gateway" section of the configuration, which I was already doing but which I have since found to be incorrect for the purposes of reliably querying the SQL database directly. I'm trying to retrieve the "History Driver" and "History Provider" under "History Settings".

Given @Kevin.Herron's reply, I'm going to try my luck with the "settings" field.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2025, 2:34am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/9 "2025-02-26T02:34:00Z")

</div>

The fields I target in the running remote tag provider come directly from the columns in the IDB you are targetting. The former are easier to target, and will likely still work when v8.3 comes out. The IDB will not.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [February 10, 2026, 12:31am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/10 "2026-02-10T00:31:54Z")

</div>

@Kevin.Herron @paul-griffith

In Ignition 8.0/8.1, I used the following code to retrieve the History Driver and History Provider for a Remote Tag Provider:

```python
Object settingsObj = IgnitionModuleUtilities.getPrivateField(tagProvider, "settings");
Method getHistoryDriverNameMethod = settingsObj.getClass().getDeclaredMethod("getHistoryDriverName");
String historyDriverName = (String) getHistoryDriverNameMethod.invoke(settingsObj);

```

In Ignition 8.3, I have found that I needed to change to this:

```python
Object settingsObj = IgnitionModuleUtilities.getPrivateField(tagProvider, "settings");
String historyDriverName = (String) IgnitionModuleUtilities.getPrivateField(settingsObj,
        "historyDriverName");

```

This works, but I wanted to ask if there’s now a supported way to do this without using reflection.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 10, 2026, 12:41am UTC](https://forum.inductiveautomation.com/t/retrieve-history-driver-and-history-provider-for-remote-tag-providers/102868/11 "2026-02-10T00:41:06Z")

</div>

From a module, you can access the raw configuration of anything using the configuration manager, as described in workarounds here:

> [@Get database name of sql based historical provider](https://forum.inductiveautomation.com/t/get-database-name-of-sql-based-historical-provider/113621/10):
>
> Right now, you could use the REST API to read the config or reach into technically unsupported territory and use the underlying ConfigurationManager directly. In some future 8.3 version, hopefully 8.3.5, you'll be able to use system.config scripting to access configuration directly.

> [@REST gateway access from perspective](https://forum.inductiveautomation.com/t/rest-gateway-access-from-perspective/113564):
>
> Hello, I would like to display (and possibly edit) the Read-Only setting of OPC UA servers in Perspective. I haven’t been able to find a corresponding tag in the System tag provider or any system function that would give me this information. Because of that, I believe my only option is to use the Gateway REST API. However, I’ve run into some HTTPS-related issues while trying to use it. Before I spend more time troubleshooting that, I’d like to make sure there isn’t another way to ac…

You'll need to know the resource type of the thing you're trying to read, and should encode a static reference to its type meta so you can safely decode it in a "safe" manner.
